<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tiamiyu Sikiru Abidemi</title>
    <description>The latest articles on DEV Community by Tiamiyu Sikiru Abidemi (@abidemit).</description>
    <link>https://dev.to/abidemit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F132591%2F5a87141b-0b0e-4226-9296-2259e68ea5ca.jpg</url>
      <title>DEV Community: Tiamiyu Sikiru Abidemi</title>
      <link>https://dev.to/abidemit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abidemit"/>
    <language>en</language>
    <item>
      <title>Day 1 all over again</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Thu, 11 Dec 2025 21:58:16 +0000</pubDate>
      <link>https://dev.to/abidemit/day-1-all-over-again-2pfc</link>
      <guid>https://dev.to/abidemit/day-1-all-over-again-2pfc</guid>
      <description>&lt;p&gt;I used to love writing and writing lyrics, time I was interested in being a rapper, had 3 tracks (interesting time), before programming took the center stage.&lt;/p&gt;

&lt;p&gt;Solid prospect, I want it back.&lt;/p&gt;

&lt;p&gt;I’m going to be writing more, it makes me feel less burdened; pour my heart and soul out. Not random stuffs, I will be doing more of day to day activities updates and technical writing.&lt;/p&gt;

&lt;p&gt;Definitely getting my MOJO back!!!&lt;/p&gt;

&lt;p&gt;Day 1 all over again.&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Building Gemini AI with Vue3: A Comprehensive Guide</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Mon, 11 Mar 2024 12:54:05 +0000</pubDate>
      <link>https://dev.to/abidemit/building-gemini-ai-with-vue3-a-comprehensive-guide-3ih3</link>
      <guid>https://dev.to/abidemit/building-gemini-ai-with-vue3-a-comprehensive-guide-3ih3</guid>
      <description>&lt;h2&gt;
  
  
  Building Gemini AI with Vue3: A Comprehensive Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Gemini AI is a powerful open-source chatbot framework that enables developers to create intelligent and interactive conversational interfaces. This guide will provide a comprehensive overview of how to build a Gemini AI bot using Vue, a popular JavaScript framework for building reactive user interfaces and Gemini API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of Vue and JavaScript&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Gemini AI Common use cases
&lt;/h3&gt;

&lt;p&gt;Gemini API has different model for different implementations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate text from text-only input&lt;/li&gt;
&lt;li&gt;Generate text from text-and-image input (multimodal)&lt;/li&gt;
&lt;li&gt;Build multi-turn conversations (chat)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The generate text from text-only input is the implementation we'll be working on in the first part of this article.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a new Vue project
&lt;/h3&gt;

&lt;p&gt;Let's create a new Vue project using the following command:&lt;br&gt;
&lt;code&gt;vue create gemini-vue-web-app&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2: Install Gemini AI
&lt;/h3&gt;

&lt;p&gt;Install the Gemini AI library using npm:&lt;br&gt;
&lt;code&gt;npm i @google/generative-ai&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3: Creating Gemini API key
&lt;/h3&gt;

&lt;p&gt;To use the Gemini API, you'll need an API key. If you don't already have one, create a key in Google AI Studio.&lt;br&gt;
&lt;a href="https://aistudio.google.com/app/apikey"&gt;Get an API key&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We'll be needing two components which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GeminiAI - which will house our question form field and also our AIAnswer component.&lt;/li&gt;
&lt;li&gt;AIAnswer - this is where our answer will be rendered. Nothing to serious here. Smiles.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  GeminiAI component
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mb-5"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hello i'm Gemini AI, ask me anything&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mb-5"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;submit.prevent=&lt;/span&gt;&lt;span class="s"&gt;"fetchAnswer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;textarea&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"question"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"question"&lt;/span&gt; &lt;span class="na"&gt;cols=&lt;/span&gt;&lt;span class="s"&gt;"30"&lt;/span&gt; &lt;span class="na"&gt;rows=&lt;/span&gt;&lt;span class="s"&gt;"10"&lt;/span&gt; &lt;span class="na"&gt;v-model=&lt;/span&gt;&lt;span class="s"&gt;"question"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;:disabled=&lt;/span&gt;&lt;span class="s"&gt;"!question"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{{&lt;/span&gt; &lt;span class="s2"&gt;`${isLoading ? 'asking gemini...' : 'Ask'&lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; &lt;span class="si"&gt;}}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mb-10&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;AIAnswer&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;answer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useGetGenerativeModelGP&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../composables/useGetGenerativeModelGP.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;AIAnswer&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/AIAnswer.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;question&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchAnswer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;
  &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;useGetGenerativeModelGP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;question&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="nx"&gt;question&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;
  &lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scss&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;scoped&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mb&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="na"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="nx"&gt;rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mb&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="na"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="nx"&gt;rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/style&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Let's breakdown the GeminiAI component:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Inside our &lt;strong&gt;template tag&lt;/strong&gt; we have 3 direct children elements, which are: h1, form and a div that has AIAnswer component as a child.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AIAnswer Component&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;v-if=&lt;/span&gt;&lt;span class="s"&gt;"answer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt; &lt;span class="si"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nf"&gt;defineProps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Answer will be displayed here.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;script tag&lt;/strong&gt; - we are buiding with vue composition api so our script tag will take a &lt;strong&gt;setup attribute&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are importing &lt;strong&gt;ref&lt;/strong&gt; from vue, &lt;strong&gt;useGetGenerativeModelGP&lt;/strong&gt; composable (which we'll talk about later) from our composables folder and lastly our AIAnswer component.&lt;br&gt;
We have &lt;strong&gt;3 reactive  states and a function&lt;/strong&gt; - question, answer, isLoading and fetchAnswer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;fetchAnswer function&lt;/strong&gt; - Our function when called, call the &lt;strong&gt;useGetGenerativeModelGP composable&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;useGetGenerativeModelGP&lt;/strong&gt; is an exported function
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;useGenAi&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./useGenAi.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useGetGenerativeModelGP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;useGenAi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gemini-pro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;where we are importing another composable named useGenAi, vue allows us to import composables in a composable file so we are taking advantage of that.&lt;/p&gt;

&lt;p&gt;Here is what our &lt;strong&gt;useGenAi&lt;/strong&gt; file looks like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;GoogleGenerativeAI&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@google/generative-ai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useGenAi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;modelType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;VITE_GOOGLE_AI_STUDIO_API_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VITE_GOOGLE_AI_STUDIO_API_KEY&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;genAI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GoogleGenerativeAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;VITE_GOOGLE_AI_STUDIO_API_KEY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;genAI&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getGenerativeModel&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;modelType&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we import GoogleGenerativeAI we installed earlier, create a useGenAi function that takes modelType parameter.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inside our &lt;strong&gt;useGenAi&lt;/strong&gt; function we have, &lt;strong&gt;VITE_GOOGLE_AI_STUDIO_API_KEY&lt;/strong&gt; variable where we assigned our generated API KEY to.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: we created a .env file in our root folder, where we stored our API Key and value.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;genAI&lt;/strong&gt; variable where we are calling a new GoogleGenerativeAI object with our API KEY.
Our &lt;strong&gt;model&lt;/strong&gt; call, &lt;strong&gt;genAI.getGenerativeModel&lt;/strong&gt;. Then we return model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Back to our &lt;strong&gt;useGetGenerativeModelGP&lt;/strong&gt; , we have variables namely:&lt;br&gt;
 &lt;strong&gt;model&lt;/strong&gt; - awaiting the useGenAi call response, the &lt;strong&gt;useGenAi&lt;/strong&gt; takes in an argument &lt;strong&gt;gemini-pro&lt;/strong&gt; which is our type of &lt;strong&gt;Gen AI model&lt;/strong&gt;.&lt;br&gt;
&lt;strong&gt;result&lt;/strong&gt; - awaiting the model.generateContent(prompt) response, the prompt we are passing as an arguement is the text our users will input.&lt;br&gt;
&lt;strong&gt;response&lt;/strong&gt; - also awaits result.response and &lt;strong&gt;text&lt;/strong&gt; - where we assign our text function call from the response variable.&lt;/p&gt;

&lt;p&gt;Then finally we return text, which is the answer our users will be seeing.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4: App.vue file
&lt;/h3&gt;

&lt;p&gt;Create Render Template&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;GeminiAI&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components/GeminiAI.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;GeminiAI&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Run the Application Run the Vue application using the following command:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/AbidemiT/Building-Gemini-AI-with-Vue-3"&gt;Github Repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://building-gemini-ai-with-vue-3.vercel.app/"&gt;Live Demo&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  By following the steps outlined in this guide, you have successfully built a basic Gemini AI text prompt with Vue 3. Gemini AI provides a powerful platform for creating intelligent conversational interfaces that can engage users and provide valuable assistance.
&lt;/h4&gt;

</description>
      <category>geminiapi</category>
      <category>vue3</category>
      <category>google</category>
      <category>vuecomposisionapi</category>
    </item>
    <item>
      <title>Form and Form Validation in React using Formik and Yup</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Thu, 13 Oct 2022 17:24:02 +0000</pubDate>
      <link>https://dev.to/abidemit/form-and-form-validation-in-react-using-formik-and-yup-9i</link>
      <guid>https://dev.to/abidemit/form-and-form-validation-in-react-using-formik-and-yup-9i</guid>
      <description>&lt;p&gt;As a frontend and software engineer in general, security is one of the key concerns when building web applications, second only to performance. So taking time to prevent external form abuse by malicious users is never a wasted effort.&lt;br&gt;
We'll be working through form valiadation and form in React by building a contact form, using Yup and Formik.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you begin this tutorial you'll need the following:&lt;/p&gt;
&lt;h2&gt;
  
  
  - React knowledge
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Yup Installed&lt;/li&gt;
&lt;li&gt;Formik Installed&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Installing React
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;setting up our project&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; npx create-react-app yup-formik-validation
 cd yup-formik-validation
 yarn start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Formik
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Formik is a library that manages form values(datas),validation and error messages, and handling of form submission. Making interacting with form as easy as a walk in the park.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Installing Formik
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add formik 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Yup
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Yup is a JavaScript schema builder for value parsing and validations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Installing Yup
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; yarn add yup 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Initialize Module
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;After all installation we'll be working inside our App.js file.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; app.js
import React, { useState } from 'react';
import { Formik, Field } from 'formik';
import * as Yup from 'yup';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our next line of action is setting up our Form and form fields using Formik, we'll  be working on 4 fields namely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First Name Field&lt;/li&gt;
&lt;li&gt;Last Name Field&lt;/li&gt;
&lt;li&gt;Email Field&lt;/li&gt;
&lt;li&gt;Message Field (using textarea element)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Before we move forward lets talk about formik element and some of it attributes.&lt;br&gt;
Formik element housing both Form element and it child element (Field elements).&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  &amp;lt;Formik&amp;gt;
    &amp;lt;Form&amp;gt;
      &amp;lt;Field&amp;gt;&amp;lt;/Field&amp;gt;
   &amp;lt;/Form&amp;gt;
    ...
  &amp;lt;/Formik&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Formik element also have some attributes that are required when setting up a form. Listed below:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;InitialValues&lt;/strong&gt; : it's contains the initial values of our fields element.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;initialValues={{
   firstName: '',
   lastName: '',
   email: '',
   message: ''
}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ValidationSchema&lt;/strong&gt; : houses our Yup validation schema, which we'll be talking about below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; // declared outside of our App function.
const validationSampleSchema = Yup.object().shape({
   firstName: Yup.string().min(1, 'First Name is too 
      short!').required('First Name field is required'),
   lastName: Yup.string().min(1, 'Last Name is too 
      short!').required('Last Name field is required'),
   email: Yup.string().email('Invalid email').required('Email 
      field is required'),
   message: Yup.string().required('Message field is required')
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Yup has different data type methods validation and conditions methods e.g min() and required()&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;validationSchema={customValidationSchema}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;passing of our custom schema to the validationSchema attribute&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;onSubmit&lt;/strong&gt; : submission function, which is an eventListener.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onSubmit={(values, { setSubmitting, resetForm }) =&amp;gt; {
  // when the handleSubmit is triggered on our submit button 
     below, every expressions and method actions get triggered

  // Reseting our form fields to empty
     resetForm({ values: "" });
}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rendering our Form and making Formik props and methods available
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{(
  {
    setFieldValue,
    values,
    errors,
    touched,
    handleSubmit
  }) =&amp;gt; (
     &amp;lt;&amp;gt;
       &amp;lt;form&amp;gt;&amp;lt;/form&amp;gt;
     &amp;lt;&amp;gt;
)}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form&amp;gt;
   &amp;lt;div className='row'&amp;gt;
      &amp;lt;div className='col-md-6'&amp;gt;
         &amp;lt;div className="form-group mb-3"&amp;gt;
            &amp;lt;label&amp;gt;First Name&amp;lt;/label&amp;gt;
            &amp;lt;Field className="form-control" name="firstName" 
              value={values.firstName} placeholder="First 
              Name"/&amp;gt;
            {errors.firstName &amp;amp;&amp;amp; touched.firstName &amp;amp;&amp;amp; (&amp;lt;small 
            className="text-danger"&amp;gt;{errors.firstName} 
            &amp;lt;/small&amp;gt;)}
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div className='col-md-6'&amp;gt;
         &amp;lt;div className="form-group mb-3"&amp;gt;
            &amp;lt;label&amp;gt;Last Name&amp;lt;/label&amp;gt;
            &amp;lt;Field name="lastName" className="form-control" 
             value={values.lastName} placeholder="Last Name" 
            /&amp;gt;
            {errors.lastName &amp;amp;&amp;amp; touched.lastName &amp;amp;&amp;amp; (&amp;lt;small 
             className="text-danger"&amp;gt;{errors.lastName} 
             &amp;lt;/small&amp;gt;)}
         &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div className='col-md-12'&amp;gt;
         &amp;lt;div className="form-group mb-3"&amp;gt;
            &amp;lt;label&amp;gt;Email&amp;lt;/label&amp;gt;
            &amp;lt;Field type="email" className="form-control" 
              value={values.email} name="email" 
              placeholder="Email" /&amp;gt;
            {errors.email &amp;amp;&amp;amp; touched.email &amp;amp;&amp;amp; (&amp;lt;small 
             className="text-danger"&amp;gt;{errors.email}&amp;lt;/small&amp;gt;)}
          &amp;lt;/div&amp;gt;
       &amp;lt;/div&amp;gt;
       &amp;lt;div className="col-md-12"&amp;gt;
          &amp;lt;div className="form-group mb-3"&amp;gt;
            &amp;lt;label&amp;gt;Drop Message&amp;lt;/label&amp;gt;
            &amp;lt;Field name="message"&amp;gt;
                  {({
                      field,
                      meta,
                  }) =&amp;gt; (
                 &amp;lt;div&amp;gt;
                   &amp;lt;textarea className="form-control" 
                    name="message" id="message"
                    placeholder="Type here" value= 
                    {values.message} rows="3" {...field} &amp;gt; 
                  &amp;lt;/textarea&amp;gt;
                  {meta.touched &amp;amp;&amp;amp; meta.error &amp;amp;&amp;amp; ( &amp;lt;small 
                  className="text-danger"&amp;gt;{meta.error}
                  &amp;lt;/small&amp;gt;)}
                &amp;lt;/div&amp;gt;
                )}
            &amp;lt;/Field&amp;gt;
         &amp;lt;/div&amp;gt;
       &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;button type="submit" className='btn btn-sm btn-success' 
     onClick={handleSubmit}&amp;gt;Submit&amp;lt;/button&amp;gt;
 &amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;two Field attributes are important to us, in our above code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;name&lt;/strong&gt;:  automatically hook up inputs to Formik using the name attribute to match up with Formik state.
&lt;code&gt;&amp;lt;Field name={'email'}/&amp;gt;&lt;/code&gt; name attribute matches the property declared in our initialValues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;value&lt;/strong&gt;: Formik access the  value through the value attribute &lt;code&gt;value={values.fieldName}&lt;/code&gt; e.g &lt;code&gt;value={values.email}&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ax6mxtywvyj3kquwrkc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ax6mxtywvyj3kquwrkc.png" alt="Yup Formik Validation Contact Form" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Errors
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{errors.firstName &amp;amp;&amp;amp; touched.firstName &amp;amp;&amp;amp; (&amp;lt;small className="text-danger"&amp;gt;{errors.firstName}&amp;lt;/small&amp;gt;)}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;whenever our field has been touched, and it contains an error, display it.&lt;br&gt;
The error setup above works with our firstName field.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Submit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button type="submit" className='btn btn-sm btn-success' 
  onClick={handleSubmit}&amp;gt;Submit&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;onClick eventlistener triggers our handleSubmit (Formik method), which is available to us when we rendered our form.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Updated onSubmit Formik attribute
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onSubmit={(values, { setSubmitting, resetForm }) =&amp;gt; {

  // assigning our values from the fields to payload variable.   
  const payload = values;

  // we have a handleNext function that saves our contact form 
     field values into a result state.
  handleNext(payload);

  // Reseting our form fields to empty
  resetForm({ values: "" });
}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [showResult, setShowResult] = useState(false);
const [result, setResult] = useState({});

const handleNext = (payload) =&amp;gt; {
    setResult(payload)
    setShowResult(true);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Yup Formik Validation Contact From End Result
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Demo &lt;br&gt;
&lt;a href="https://yupformikvalidationdemo.netlify.app"&gt;Yup Formik Validation Contact Form Demo&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Working with form in react is very tasking, coupled with trying to setup validation to our form fields, as we all know Form Validation is an integral part of building a web application, and Formik helps in working with forms in React doing the hard part and leaving us to worry more on other important part in our web app development, same way Yup handles our validations.&lt;/p&gt;

&lt;p&gt;Check out the following official documentations to get a broader explanations on our subject matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://formik.org/"&gt;Formik&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jquense/yup"&gt;Yup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also find the full code source on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/AbidemiT/yup-formik-react-validation"&gt;Yup Formik Validation In React&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Attributions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://formik.org/"&gt;Formik&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jquense/yup"&gt;Yup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have questions? Facing issues implementing?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Drop a comment let work through them together.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Do you find this helpful?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can follow me here on Dev and also on Twitter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/Eeskay01"&gt;Abidemi Tiamiyu&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
      <category>formvalidations</category>
      <category>formik</category>
      <category>yup</category>
    </item>
    <item>
      <title>Vuex Pratical Implementation In Nuxt</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Sat, 15 Jan 2022 23:04:39 +0000</pubDate>
      <link>https://dev.to/abidemit/vuex-pratical-implementation-in-nuxt-4e2m</link>
      <guid>https://dev.to/abidemit/vuex-pratical-implementation-in-nuxt-4e2m</guid>
      <description>&lt;p&gt;&lt;strong&gt;INTRODUCTION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this post we'll be looking into practical ways of working with &lt;strong&gt;Vuex in Nuxt&lt;/strong&gt;, and setting up nuxt project.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;NUXT INSTALLATION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We have different ways of setting up Nuxt project&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using create-nuxt-app&lt;/li&gt;
&lt;li&gt;Manual Installation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;to move quickly use &lt;strong&gt;create-nuxt-app&lt;/strong&gt;, to get started:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Yarn
yarn create nuxt-app &amp;lt;project-name&amp;gt;

// Npm
npm init nuxt-app &amp;lt;project-name&amp;gt;

//Npx
npx create-nuxt-app &amp;lt;project-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;questions on tools and packages will be asked after answering all, dependencies will be installed then you can do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// yarn
cd &amp;lt;project-name&amp;gt;
yarn dev

//npm
cd &amp;lt;project-name&amp;gt;
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for more info on the installation process checkout the Nuxt official Docs &lt;a href="https://nuxtjs.org/docs/get-started/installation"&gt;Nuxt Installation&lt;/a&gt; &lt;/p&gt;


&lt;br&gt;
&lt;strong&gt;SETTING UP VUEX IN NUXT&lt;/strong&gt;

&lt;p&gt;Before we move further we've different ways to setup vuex in Nuxt &lt;a href="https://masteringnuxt.com/blog/four-ways-to-setup-vuex-in-nuxt"&gt;Checkout Josh Deltener 4 Ways To Setup Vuex in Nuxt&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Going further we'll be working with the third method from &lt;strong&gt;Josh Deltene's Four ways to setup Vuex in NUXT which is Namespaced, one file&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Namespaced, one file:&lt;/strong&gt; Inside our store directory we'll be having a unique state feature named file for example: auth.js, cart.js, payment.js and order.js inside where we'll be having our state, actions, mutations and getters which will be exported.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UKRmYaLr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1642195245199/xvc0APTX7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UKRmYaLr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1642195245199/xvc0APTX7.png" alt="namespaced-one-file.png" width="134" height="74"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const state = () =&amp;gt; ({
})

export const mutations = {
}

export const actions = {
}

export const getters = {
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;br&gt;
&lt;strong&gt;SETTING UP state, actions, mutation and getters&lt;/strong&gt;

&lt;p&gt;Inside our namespaced file we'll create our state which should always be a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// State
export const state = () =&amp;gt; ({
  paymentMethods: [],
})

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mutations, actions and getters will be exported as an object&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// Mutation
export const mutations = {
  SET_PAYMENT_METHODS(state, payload) {
    state.paymentMethods = payload
  },
}

// Action
export const actions = {
  async fetchPaymentMethods({commit}) {
    try {
      let response = await pay(this.$axios).fetchPaymentMethods()
      // we commit the incoming data so as to update the state data
      commit('SET_PAYMENT_METHODS', response.data.data)
    } catch (error) {
    }
  },
}

// Getter
export const getters = {
  getPaymentMethods: (state) =&amp;gt; state.paymentMethods,
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;br&gt;
&lt;strong&gt;ACCESSING STORE DATA IN OUR COMPONENT&lt;/strong&gt;&lt;br&gt;
Firstly to access store data in our component we need to import vuex inside the script tag&lt;br&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
import {mapGetters} from "vuex"
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;to access a data from the store state or getter we'll do the following in our computed property&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;computed: {
// getters
    ...mapGetters({
      // getPaymentMethods we created in the getter above
      paymentMethods: 'payment/getPaymentMethods',
    }),

// state
     paymentMethods(){
        return this.$store.state.payment.paymentMethods
     }
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;br&gt;&lt;br&gt;
** EXECUTING ACTIONS AND MUTATIONS**&lt;br&gt;
&lt;/p&gt;
&lt;br&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.$store.dispatch('payment/fetchPaymentMethods')

this.$store.commit('payment/SET_PAYMENT_METHODS')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;br&gt;&lt;br&gt;
** SUMMARY **&lt;br&gt;
&lt;/p&gt;
&lt;br&gt;
So far, we've seen practical examples of how to setup Nuxt project,  work with vuex in our Nuxt project and enjoy the out of box vuex setup.

&lt;p&gt;We still have some other interesting features which we'll be sharing together, stick around for more.&lt;/p&gt;

&lt;p&gt;I hope you find this post helpful and if you do, you can follow me on &lt;a href="https://twitter.com/eeskay01"&gt;Twitter&lt;/a&gt;   &lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>vuex</category>
      <category>vue</category>
    </item>
    <item>
      <title>Using vue-awesome-swiper in a Nuxt Project</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Wed, 20 Jan 2021 14:34:03 +0000</pubDate>
      <link>https://dev.to/abidemit/using-vue-awesome-swiper-in-a-nuxt-project-1co</link>
      <guid>https://dev.to/abidemit/using-vue-awesome-swiper-in-a-nuxt-project-1co</guid>
      <description>&lt;h1&gt;
  
  
  Take Home from this Article?
&lt;/h1&gt;

&lt;p&gt;This article will take you through the step by step guide of setting up &lt;em&gt;vue-awesome-swiper&lt;/em&gt; in a nuxt project, how to add custom styling to &lt;em&gt;vue-awesome-swiper&lt;/em&gt; and responsiveness.&lt;/p&gt;

&lt;h1&gt;
  
  
  What's vue-awesome-swiper?
&lt;/h1&gt;

&lt;p&gt;vue-awesome-swiper is a slider component built with vue and makes setting up a slider easier on frameworks such as Vue and Nuxt.&lt;br&gt;
Built By: &lt;a href="https://github.com/surmon-china"&gt;Surmon China&lt;/a&gt;&lt;br&gt;
Url: &lt;a href="https://github.com/surmon-china/vue-awesome-swiper"&gt;vue-awesome-swiper&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Let's get Started
&lt;/h1&gt;

&lt;p&gt;install vue-awesome-swiper&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install swiper vue-awesome-swiper --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add swiper vue-awesome-swiper

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Next&lt;/strong&gt;&lt;br&gt;
Create &lt;em&gt;vue-awesome-swiper.js&lt;/em&gt; file in the Plugin Folder&lt;br&gt;
inside the &lt;em&gt;vue-awesome-swiper.js&lt;/em&gt; file add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Vue from 'vue';
import VueAwesomeSwiper from 'vue-awesome-swiper';

// import custom style
import '@/assets/css/swiper.css';

Vue.use(VueAwesomeSwiper);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Add&lt;/em&gt; vue-awesome-swiper source to the plugins array in nuxt.config.js file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plugins: [
    { src: '@/plugins/vue-awesome-swiper', mode: 'client' }
  ],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's Create a Slider Component inside our Components Folder and Add the following Code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div v-swiper="swiperOption" class="w-5/6 ml-auto relative" :loadtheme="false"&amp;gt;
    &amp;lt;div class="swiper-wrapper"&amp;gt;
      &amp;lt;div class="swiper-slide" :key="banner" v-for="banner in banners"&amp;gt;
        &amp;lt;!-- Render original HTML in server, render Swiper in browser (client) --&amp;gt;
        &amp;lt;img class="h-64 w-64" :src="banner" /&amp;gt;

      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="swiper-button-prev" slot="button-prev"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="swiper-button-next" slot="button-next"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
import { directive } from "vue-awesome-swiper";

export default {
  name: "Slider",
  directives: {
    swiper: directive,
  },
  data() {
    return {
      banners: ["/slider-1.png", "/slider-2.png", "/slider-3.png"],
      swiperOption: {
        slidesPerView: 3,
        spaceBetween: -10,
        slidesPerGroup: 3,
        loop: true,
        loopFillGroupWithBlank: true,
        pagination: {
          el: ".swiper-pagination",
          clickable: true,
        },
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev",
        },
        breakpoints: {
            1024: {
              slidesPerView: 4,
              spaceBetween: 10
            },
            768: {
              slidesPerView: 3,
              spaceBetween: 10
            },
            640: {
              slidesPerView: 2,
              spaceBetween: 10
            },
            320: {
              slidesPerView: 1,
              spaceBetween: 10
            }
          }
      },
    };
  },
};
&amp;lt;/script&amp;gt;

&amp;lt;style scoped&amp;gt;
.swiper-pagination-bullet.swiper-pagination-bullet-active::after {
  @apply w-48 h-48 ;
}
&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have different usage: &lt;br&gt;
Directive and the only difference in the use of the Component&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;component find Swiper instance by ref attribute.&lt;/li&gt;
&lt;li&gt;directive find Swiper instance by directive arg.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;we opted for Directive usage, The effect of the two ways and the difference in the applicable environment can be found &lt;a href="https://github.com/surmon-china/surmon-china.github.io/blob/source/projects/vue-awesome-swiper/nuxt/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Voila!!! you're good to go.&lt;/p&gt;

&lt;p&gt;Check Out &lt;a href="https://github.surmon.me/vue-awesome-swiper/"&gt;Swiper Examples&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Addition: Custom Styling for Vue Awesome Swiper&lt;br&gt;
You can create a CSS file for your custom styling by creating a CSS file and add it to the CSS folder inside the assets folder and import into vue-awesome-swiper.js file inside the Plugins Folder or&lt;br&gt;
Find swiper folder inside node_modules folder and copy swiper.css file from the CSS folder into Assets CSS folder and tweak to your satisfaction(Like I did).&lt;/p&gt;

&lt;p&gt;vue-awesome-swiper is one of the best slider components for Vue and Nuxt all Thanks to &lt;a href="https://github.com/surmon-china"&gt;Surmon China&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope you find this article useful, best wishes.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>nuxt</category>
      <category>frontend</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>Difference between Imperative and Declarative Code</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Mon, 10 Jun 2019 08:25:20 +0000</pubDate>
      <link>https://dev.to/abidemit/difference-between-imperative-and-declarative-code-226o</link>
      <guid>https://dev.to/abidemit/difference-between-imperative-and-declarative-code-226o</guid>
      <description>&lt;h2&gt;
  
  
  Definition and Code Example:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Imperative&lt;/strong&gt; - Implementing a procedure to follow in rendering a code function. A good basic example: let's assume we have a button with id "btn" in our html file we want to add an event listener to in changing the body background, our imperative code will look something like:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;button id="btn"&amp;gt;Change bgColor&amp;lt;/button&amp;gt;

     let btn = document.querySelector('#btn');
     let parent = document.querySelector('body');
     btn.addEventListener('click', () =&amp;gt; {
        parent.style.backgroundColor = "orange";
     });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The above code snippet is an imperative way of solving code issue. Vanilla Javascript style.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Declarative&lt;/strong&gt; - Relying on methods or packages to handle the processes involved in rendering a code function.
Also solving the above code issue in a declarative manner will look something like this.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;button onclick="changeBgColor()"&amp;gt;Change bgColor&amp;lt;/button&amp;gt;

    &amp;lt;script&amp;gt;
        function changeBgColor() {
            let parent = document.querySelector('body');
            parent.style.backgroundColor = "orange";
        }
    &amp;lt;/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;frameworks like React and Vue uses Declarative code and Vanilla old style of adding eventlisteners.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  to be Cont'd
&lt;/h4&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Give more intermediate examples.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>beginners</category>
      <category>vanillajs</category>
      <category>imperativecode</category>
      <category>declarativecode</category>
    </item>
    <item>
      <title>Sequelize Model.update</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Sun, 10 Feb 2019 21:29:58 +0000</pubDate>
      <link>https://dev.to/abidemit/sequelize-modelupdate-nep</link>
      <guid>https://dev.to/abidemit/sequelize-modelupdate-nep</guid>
      <description>&lt;p&gt;Using sequelize for model creation, i needed to update my database so i used Model.findByIdAndUpdate which returned an error and i later found the right way to update to the database using &lt;br&gt;
    Model.update({&lt;br&gt;
            title:  'Updated title '&lt;br&gt;
        },&lt;br&gt;
        {&lt;br&gt;
        where: &lt;br&gt;
        {&lt;br&gt;
            id: 1&lt;br&gt;
        }&lt;br&gt;
      })&lt;br&gt;
I hope this helps someone out there... or is their any other way ? i will like to know thanks.&lt;br&gt;
example below:&lt;br&gt;
&lt;a href="https://thepracticaldev.s3.amazonaws.com/i/xv3dnnshqqitd1gs9k66.png"&gt;https://thepracticaldev.s3.amazonaws.com/i/xv3dnnshqqitd1gs9k66.png&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sequelize</category>
      <category>mysql</category>
      <category>node</category>
      <category>express</category>
    </item>
    <item>
      <title>Your Mate</title>
      <dc:creator>Tiamiyu Sikiru Abidemi</dc:creator>
      <pubDate>Mon, 04 Feb 2019 22:40:58 +0000</pubDate>
      <link>https://dev.to/abidemit/your-mate-23d4</link>
      <guid>https://dev.to/abidemit/your-mate-23d4</guid>
      <description>&lt;p&gt;"Your Mate"&lt;br&gt;
that statement crushed a lot of souls and will still continue to do so, but it shouldn't crush you. When people closer to you utter that statement and tell you your mates are these and that never let it get to you and have this in you: you're nobody's mate and no one is your mate, we all have our different working time. Trust your process and be persistent. 😎&lt;/p&gt;

</description>
      <category>beginer</category>
    </item>
  </channel>
</rss>
