<?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: Mustofa Ghaleb Amami</title>
    <description>The latest articles on DEV Community by Mustofa Ghaleb Amami (@cakasuma).</description>
    <link>https://dev.to/cakasuma</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%2F416010%2F5fa6567b-d7f3-41c5-af7a-e1f498215ded.jpeg</url>
      <title>DEV Community: Mustofa Ghaleb Amami</title>
      <link>https://dev.to/cakasuma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cakasuma"/>
    <language>en</language>
    <item>
      <title>Build &amp; Ship a Real App From Your Phone — No Laptop Needed</title>
      <dc:creator>Mustofa Ghaleb Amami</dc:creator>
      <pubDate>Sat, 21 Mar 2026 15:38:12 +0000</pubDate>
      <link>https://dev.to/cakasuma/build-ship-a-real-app-from-your-phone-no-laptop-needed-4p56</link>
      <guid>https://dev.to/cakasuma/build-ship-a-real-app-from-your-phone-no-laptop-needed-4p56</guid>
      <description>&lt;p&gt;For most of computing history, building software required a dedicated machine. You needed a laptop, a development environment set up just right, a code editor, a terminal, package managers — and hours of configuration before you ever wrote a single line of your actual idea.&lt;/p&gt;

&lt;p&gt;That's a high bar. And it kept a lot of people out. That bar just got a lot lower.&lt;/p&gt;

&lt;p&gt;I shipped two live apps from my phone. No laptop. No local dev environment. No IDE. Just me, my phone, and three tools: &lt;strong&gt;Claude&lt;/strong&gt;, &lt;strong&gt;GitHub Copilot&lt;/strong&gt;, and &lt;strong&gt;Vercel&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 The Three Tools (And What Each One Does)
&lt;/h2&gt;

&lt;p&gt;Think of this as a three-person team, except each "person" is an AI tool — and they each have a very specific job.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🤖 &lt;strong&gt;Claude&lt;/strong&gt; — &lt;em&gt;Starts the project.&lt;/em&gt; Describe what you want in plain English. Claude writes the full boilerplate: file structure, code, configuration, everything. No setup, no scaffolding — just a complete starting point.&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;GitHub Copilot&lt;/strong&gt; — &lt;em&gt;Handles updates.&lt;/em&gt; Once your project exists, Copilot Agent reads your entire codebase and makes changes based on plain-language instructions. It edits the right files, commits, and pushes — all from your browser.&lt;/li&gt;
&lt;li&gt;🚀 &lt;strong&gt;Vercel&lt;/strong&gt; — &lt;em&gt;Previews &amp;amp; ships.&lt;/em&gt; Connect your GitHub repo to Vercel once, and every push triggers an automatic deployment. Real preview URL to share and test. When you're happy, deploy to production with a tap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the whole stack. Three tools, three clear roles, zero laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  01 — Start with Claude
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://claude.ai" rel="noopener noreferrer"&gt;claude.ai&lt;/a&gt; on your phone's browser. Write something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Build me a calculator app with a clean UI. Use HTML, CSS, and vanilla JavaScript. Keep it simple and mobile-friendly."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude responds with a complete project. Copy the files into your GitHub repository — you can create one and paste files right in the browser at github.com. No terminal, no clone, no setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  02 — Iterate with Copilot Agent
&lt;/h2&gt;

&lt;p&gt;Open GitHub Copilot in your browser with Agent mode turned on. Point it at your repo. Now make requests:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Add a calculation history panel on the side."&lt;br&gt;
"Make the buttons larger on mobile."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Copilot reads your existing code, makes the right edits, and commits them. You don't touch a single file manually. Repeat this as many times as you need — each iteration is just a sentence.&lt;/p&gt;

&lt;h2&gt;
  
  
  03 — Preview and Ship with Vercel
&lt;/h2&gt;

&lt;p&gt;Every commit you push triggers a build on Vercel. You get a preview URL — a real, live, shareable link — within a minute or two. Test it on your phone. Send it to a friend. When it's ready, promote it to your production domain.&lt;/p&gt;

&lt;p&gt;That's the full loop. Claude starts it. Copilot refines it. Vercel ships it. All from your phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Proof: Apps I Built This Way
&lt;/h2&gt;

&lt;p&gt;I didn't just theorize about this workflow — I used it to ship two real apps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://calculator.amammustofa.com" rel="noopener noreferrer"&gt;calculator.amammustofa.com&lt;/a&gt;&lt;/strong&gt; — A fully functional calculator app with calculation history. Described it to Claude, had Copilot add the history feature, and Vercel had it live at my domain in under an hour. All from my phone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://hijriah.amammustofa.com" rel="noopener noreferrer"&gt;hijriah.amammustofa.com&lt;/a&gt;&lt;/strong&gt; — An Islamic Hijriah ↔ Gregorian calendar converter. A real utility app, with real users, built without ever opening a laptop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both apps are live right now. Both were built entirely on mobile.&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 Why This Matters
&lt;/h2&gt;

&lt;p&gt;The common narrative is that AI tools make existing developers faster. That's true. But the more interesting thing is what happens at the edges — when people who couldn't build before suddenly can.&lt;/p&gt;

&lt;p&gt;You don't need a CS degree. You don't need to memorize syntax. You don't even need a laptop. If you have an idea and a phone, you have a development environment.&lt;/p&gt;

&lt;p&gt;The bottleneck used to be access to tools and knowledge. Now it's just whether you have something worth building. That's a meaningful shift.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Try It Tonight
&lt;/h2&gt;

&lt;p&gt;Here's a 30-minute starting point:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Open Claude and describe your app&lt;/strong&gt;&lt;br&gt;
Go to &lt;a href="https://claude.ai" rel="noopener noreferrer"&gt;claude.ai&lt;/a&gt; on your phone. Describe an app you've been meaning to build. Be specific about what it should do and look like. Copy Claude's output into a new GitHub repo — create one and paste files right in the browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Use Copilot Agent to iterate&lt;/strong&gt;&lt;br&gt;
Open &lt;a href="https://github.com" rel="noopener noreferrer"&gt;github.com&lt;/a&gt; and enable GitHub Copilot with Agent mode. Navigate to your repo. Ask Copilot to make a change, add a feature, or fix something. Let it do the work and commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Deploy on Vercel&lt;/strong&gt;&lt;br&gt;
Go to &lt;a href="https://vercel.com" rel="noopener noreferrer"&gt;vercel.com&lt;/a&gt; and connect your repo. Import it, set your domain if you have one, and deploy. Your app will be live at a real URL in minutes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your phone is already a development environment. You just didn't know it yet.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>mobile</category>
      <category>ai</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>GitHub Copilot in 2025: Agents, PR Reviews &amp; Coding on the Go</title>
      <dc:creator>Mustofa Ghaleb Amami</dc:creator>
      <pubDate>Sat, 21 Mar 2026 15:36:57 +0000</pubDate>
      <link>https://dev.to/cakasuma/github-copilot-in-2025-agents-pr-reviews-coding-on-the-go-19nf</link>
      <guid>https://dev.to/cakasuma/github-copilot-in-2025-agents-pr-reviews-coding-on-the-go-19nf</guid>
      <description>&lt;p&gt;When GitHub Copilot first launched, it felt like a very clever autocomplete — one that could finish your function after reading a comment. That was already useful enough. But over the past year, Copilot has quietly grown into something much more interesting: an AI that can take on entire tasks end-to-end, leave review comments on your PRs like a senior teammate, and even follow you away from your desk via the GitHub mobile app.&lt;/p&gt;

&lt;p&gt;If your mental model of Copilot is still "it fills in my code as I type", this post is for you. Let me walk through the three changes that have made Copilot genuinely indispensable in my day-to-day workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤖 Copilot Agents: Let It Do the Whole Thing
&lt;/h2&gt;

&lt;p&gt;Agent mode is the headline feature of modern Copilot. Instead of suggesting the next line, you give Copilot a goal — "add input validation to the registration form and write tests for it" — and it figures out the steps on its own: reading the relevant files, making the changes, running tests, and fixing failures until everything is green.&lt;/p&gt;

&lt;p&gt;What makes this feel different from just pasting code into Chat is that Copilot operates on your actual workspace. It reads the files it needs, edits them, runs your terminal commands, and iterates. It's the difference between asking someone for advice and handing them the keyboard.&lt;/p&gt;

&lt;p&gt;Agent mode is available today in VS Code (as "Copilot Edits" and the experimental agent panel), JetBrains IDEs, and increasingly through GitHub itself for Copilot Workspace. The sweet spot for agents right now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧪 &lt;strong&gt;Writing test suites&lt;/strong&gt;: Give it a module and ask for full coverage — it reads the code, writes tests, runs them, and fixes failures.&lt;/li&gt;
&lt;li&gt;♻️ &lt;strong&gt;Refactoring&lt;/strong&gt;: Rename a concept across the whole codebase, migrate to a new API, or split a large file — without touching every file yourself.&lt;/li&gt;
&lt;li&gt;🐛 &lt;strong&gt;Bug fixing&lt;/strong&gt;: Paste a failing test or error log. Copilot traces the cause, makes a fix, and confirms the test passes.&lt;/li&gt;
&lt;li&gt;📄 &lt;strong&gt;Boilerplate generation&lt;/strong&gt;: Scaffold a new feature end-to-end: component, service, types, and tests — all consistent with your existing patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing I've learned: be specific about the outcome you want, not the steps. "Add form validation" is fine; "use Zod, keep existing field names, and make sure error messages are inline" is much better. The more constraints you give it, the less back-and-forth you need.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 Copilot on Pull Requests: Your Always-Available Reviewer
&lt;/h2&gt;

&lt;p&gt;One of the most underrated Copilot features is its ability to review pull requests. Once enabled for a repository, Copilot automatically reviews every PR and posts inline comments — the same way a human reviewer would — pointing out potential bugs, suggesting improvements, and flagging anything that looks off.&lt;/p&gt;

&lt;p&gt;The comments appear in the standard GitHub PR review interface. You can respond to them, apply the suggested one-line fixes directly from the diff view, or dismiss them just like any other review comment. There's no separate workflow to learn.&lt;/p&gt;

&lt;p&gt;Beyond line-level review comments, Copilot also generates a plain-language PR summary at the top — a quick paragraph explaining what changed and why — which is handy when you're reviewing someone else's work and want context before you dive into the diff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Copilot PR reviews catch well:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edge cases the author missed (empty arrays, null values, boundary conditions)&lt;/li&gt;
&lt;li&gt;Inconsistency with patterns used elsewhere in the codebase&lt;/li&gt;
&lt;li&gt;Security concerns in input handling or data access&lt;/li&gt;
&lt;li&gt;Missing error handling or inadequate logging&lt;/li&gt;
&lt;li&gt;Opportunities to simplify logic or remove duplication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is not a replacement for human review — it occasionally flags things that are intentional, and it won't catch issues that require deep domain knowledge. But as a first pass that runs before anyone else even looks at the PR, it catches a surprising amount. On my team, the number of review rounds before merge dropped noticeably after we enabled it.&lt;/p&gt;

&lt;h2&gt;
  
  
  📱 Copilot on Mobile: Code Review in Your Pocket
&lt;/h2&gt;

&lt;p&gt;This one surprised me more than I expected. GitHub's mobile app (iOS and Android) now has Copilot Chat built right in. That means you can pull up a PR on your phone during your commute and ask Copilot to summarise the changes, explain a confusing diff, or tell you if there are any concerns — all in plain English, without needing to mentally parse the raw diff on a small screen.&lt;/p&gt;

&lt;p&gt;You can chat with Copilot about the specific PR you're looking at, ask it general questions about the repository, or even explore files. It's the same model as the desktop, just in a conversational format that works well on a phone.&lt;/p&gt;

&lt;p&gt;In practice, I use it mostly for three things away from my desk:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quick PR triage&lt;/strong&gt; — checking if a PR is ready to review or still needs work, without opening a laptop&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Async code questions&lt;/strong&gt; — asking about a piece of code someone mentioned in a message, so I can respond with something useful&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Catching up after meetings&lt;/strong&gt; — getting a plain-English summary of what changed while I was in calls&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To enable it: update the GitHub app on iOS or Android, navigate to any repository or pull request, and look for the Copilot icon in the toolbar. Sign in with your GitHub account that has Copilot enabled and you're ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 Tips That Actually Help
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Be specific about constraints, not just goals&lt;/strong&gt;&lt;br&gt;
"Add error handling" gives Copilot too much freedom. "Add error handling using our existing &lt;code&gt;AppError&lt;/code&gt; class, log with the existing logger, and return a 422 for validation errors" gives it exactly what it needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ask agents to explain what they did&lt;/strong&gt;&lt;br&gt;
After an agent finishes a task, follow up with "explain the changes you made". It forces you to actually review the output and often surfaces decisions that need your input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Treat PR review comments as a starting point&lt;/strong&gt;&lt;br&gt;
Copilot's review comments are suggestions, not verdicts. Use them to catch things you might have missed, but dismiss anything that doesn't apply to your context. Over time you get a feel for which categories of comment are reliable for your codebase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use mobile Copilot for async, not deep work&lt;/strong&gt;&lt;br&gt;
The mobile experience shines for quick questions and triage. For anything requiring actual editing or multi-turn investigation, wait until you're back at your desk with the full IDE experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Always review before merging&lt;/strong&gt;&lt;br&gt;
Agent-generated code is often surprisingly good, but it is not infallible. Read through changes before committing them, especially in security-sensitive areas. Copilot moves fast — your job is to make sure it moved in the right direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚠️ Things Worth Knowing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agents can go sideways:&lt;/strong&gt; Occasionally an agent will loop on a failing test or make a change that breaks something else. Set a time limit in your head — if it's been more than a few iterations without progress, take back the keyboard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PR reviews are noisy at first:&lt;/strong&gt; When you first enable Copilot reviews on a large codebase, it will flag patterns that are actually fine for your project. Spend 20 minutes on the first few PRs dismissing and categorising — it gets much cleaner quickly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile is read-heavy by design:&lt;/strong&gt; The mobile Copilot is great for understanding and discussion, not for large-scale edits. Don't try to use it to write features on your phone — that's not the use case it was built for.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security always needs human eyes:&lt;/strong&gt; For authentication flows, cryptography, or data access, don't rely solely on Copilot's review comment or agent output. These areas need careful human review regardless of what AI suggests.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎯 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The version of Copilot in 2025 is meaningfully different from the one that launched. Agents let you delegate whole tasks rather than individual lines. PR review integration means every pull request gets a first-pass review before any human looks at it. And mobile support means you can stay informed and answer questions about your codebase from anywhere.&lt;/p&gt;

&lt;p&gt;None of these features replace the judgment, taste, or domain knowledge that good engineers bring — but they do eliminate a lot of the friction that gets in the way of shipping. If you haven't revisited Copilot recently, it's worth a fresh look.&lt;/p&gt;

</description>
      <category>github</category>
      <category>ai</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>MobX 6 with multiple stores using React hooks</title>
      <dc:creator>Mustofa Ghaleb Amami</dc:creator>
      <pubDate>Sat, 20 Feb 2021 17:33:58 +0000</pubDate>
      <link>https://dev.to/cakasuma/using-mobx-hooks-with-multiple-stores-in-react-3dk4</link>
      <guid>https://dev.to/cakasuma/using-mobx-hooks-with-multiple-stores-in-react-3dk4</guid>
      <description>&lt;p&gt;When an app becomes bigger and more states to manage. We can add more stores making the store specific to their usage. In this post, I am going to share my approach to how to manage states with multiple stores to your react site. &lt;/p&gt;

&lt;h3&gt;
  
  
  Get started
&lt;/h3&gt;

&lt;p&gt;Assumed you have a React app ready, we can install the necessary dependencies to work with MobX.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i mobx mobx-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create stores
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;We will create 2 stores, user and note store, user store will only have a user name as observable and a set function to modify the name. Note store will be keeping an array of notes. To display communication between stores, each note will have the user name who posts the note. Afterward, we can use the store to our app using hooks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To begin, create a new folder called &lt;code&gt;stores&lt;/code&gt; in the &lt;code&gt;src&lt;/code&gt; directory&lt;br&gt;
&lt;code&gt;/src/stores/&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Create user store
&lt;/h4&gt;

&lt;p&gt;Add a new file inside stores folder &lt;code&gt;/src/stores/user.store.js&lt;/code&gt;&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="c1"&gt;// src/stores/user.store.js&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;makeAutoObservable&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="s2"&gt;mobx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;userStore&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;makeAutoObservable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;setUserName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&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="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;userStore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;the &lt;code&gt;makeAutoObservable&lt;/code&gt; utility function introduced in MobX version 6.0 and above, you can use makeObservable/decorate if you use the older version of MobX.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Create note store
&lt;/h4&gt;

&lt;p&gt;Add a new file inside stores folder &lt;code&gt;/src/stores/note.store.js&lt;/code&gt;&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="c1"&gt;// src/stores/note.store.js&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;makeAutoObservable&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="s2"&gt;mobx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;noteStore&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

    &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;makeAutoObservable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;addNote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;send_note&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;note&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;send_note&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;noteStore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Link the stores together
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;We will create context hooks as the interface to connect to the stores using hooks and create a root/main store that will link all of our stores. Root store will also be used to communicate between stores&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Create root store
&lt;/h4&gt;

&lt;p&gt;Add an index file inside stores folder &lt;code&gt;/src/stores/index.js&lt;/code&gt;&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="c1"&gt;// src/stores/index.js&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;UserStore&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./user.store&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;NoteStore&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./note.store&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;RootStore&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;UserStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;noteStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;NoteStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;)&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;blockquote&gt;
&lt;p&gt;note that we are passing &lt;code&gt;this&lt;/code&gt; to the stores so that every store will have access to other stores by accessing the context passed to their constructor&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Communicate between stores
&lt;/h4&gt;

&lt;p&gt;Modify note store &lt;code&gt;/src/stores/note.store.js&lt;/code&gt; so that each note addition will have the user name who post it&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="c1"&gt;// src/stores/note.store.js&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;makeAutoObservable&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="s2"&gt;mobx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;noteStore&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

    &lt;span class="c1"&gt;// `this` from rootstore passed to the constructor and we can &lt;/span&gt;
    &lt;span class="c1"&gt;// assign it to a variable accessible in this class called &lt;/span&gt;
    &lt;span class="c1"&gt;// `rootStore`. Therefore, we can access other store like &lt;/span&gt;
    &lt;span class="c1"&gt;// useStore for e.g (this.rootStore.userStore)&lt;/span&gt;
    &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rootStore&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rootStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;rootStore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;makeAutoObservable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;addNote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;send_note&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;note&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

        &lt;span class="c1"&gt;// check if name is available on userstore&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rootStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;send_note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rootStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;send_note&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;noteStore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Expose stores from context
&lt;/h4&gt;

&lt;p&gt;Modify index &lt;code&gt;/src/stores/index.js&lt;/code&gt; to use react context on the root store&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="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;UserStore&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./user.store&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;NoteStore&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./note.store&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;RootStore&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;UserStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;noteStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;NoteStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&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;StoresContext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;RootStore&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="c1"&gt;// this will be the function available for the app to connect to the stores&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;useStores&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;StoresContext&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use the stores in the app
&lt;/h3&gt;

&lt;p&gt;All store setup is now done, Great!. now it's time to use them in our app.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We will create the component in &lt;code&gt;src/App.js&lt;/code&gt; file to access the stores, the component will have two input fields, &lt;br&gt;
the first input field will be to change the name. the name changed will be reflected in a text above the input field.&lt;br&gt;
the second input field will be to add a new note. note list can be found below the input field.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/App.js&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;useState&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="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&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;useObserver&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="s2"&gt;mobx-react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// this is the hook function we have made on `stores/index.js` to access all of our stores&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;useStores&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="s2"&gt;./stores&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// here you can access all of the stores registered on the root store&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;noteStore&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;userStore&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useStores&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setNote&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&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="c1"&gt;// tracking the name change&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleNameChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&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;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&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="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// access the user store set name action&lt;/span&gt;
    &lt;span class="nx"&gt;userStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setUserName&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="p"&gt;};&lt;/span&gt;

  &lt;span class="c1"&gt;// tracking the note change&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleNoteChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&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;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&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="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;setNote&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="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;addNote&lt;/span&gt; &lt;span class="o"&gt;=&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="c1"&gt;// access the note store action adding note to the notes array&lt;/span&gt;
    &lt;span class="nx"&gt;noteStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addNote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="c1"&gt;// since we want to observe the change in name and list, useObserver is required, otherwise, we can straightaway return jsx&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;useObserver&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&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;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;hello&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&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;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Change&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="nx"&gt;here&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&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;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleNameChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&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;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Insert&lt;/span&gt; &lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&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;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleNoteChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&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;button&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;addNote&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nx"&gt;Add&lt;/span&gt; &lt;span class="nx"&gt;note&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="nx"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Note&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;noteStore&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;noteStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;idx&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;idx&lt;/span&gt;&lt;span class="p"&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;h3&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h3&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;code&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;note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/code&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;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;))&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;No&lt;/span&gt; &lt;span class="nx"&gt;note&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="p"&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="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🎉 End result
&lt;/h3&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/epic-edison-p0ws6"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  End notes
&lt;/h3&gt;

&lt;p&gt;There are still many improvements that can be done from here, make stores that suit your needs, add more functions, handling APIs, persistent stores by saving them to local/session storage, and many more. Let's try those in the next post 😉&lt;/p&gt;

</description>
      <category>mobx</category>
      <category>react</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>My Coding Journey, and Coding Tips</title>
      <dc:creator>Mustofa Ghaleb Amami</dc:creator>
      <pubDate>Sat, 23 Jan 2021 20:27:44 +0000</pubDate>
      <link>https://dev.to/cakasuma/my-coding-journey-and-coding-tips-268g</link>
      <guid>https://dev.to/cakasuma/my-coding-journey-and-coding-tips-268g</guid>
      <description>&lt;h2&gt;
  
  
  Hello Everyone and dev.to!
&lt;/h2&gt;

&lt;p&gt;I am Mustofa, Indonesian, 22 yo. This is my first time writing an article, probably in my entire life, so this might have many mistakes within the contents or words. This is just to share my coding journey briefly and give some coding tips from my opinion and experience. Last but not least, I hope this post can be useful for some people. Enjoy.&lt;/p&gt;

&lt;h2&gt;
  
  
  My coding journey
&lt;/h2&gt;

&lt;h3&gt;
  
  
  High school
&lt;/h3&gt;

&lt;p&gt;5 years ago In a small city where everyone's popular job was only when you become a doctor, police, accountant, or business. Everyone and I thought I might become a great doctor. So I took a science stream in my high school. That day I got my laptop broken and brought it to a random tech workshop in a nearby mall, the way he was fixing it looked really cool so it gains my curiosity in IT. We had great conversations and became friends. He told me many interesting things about IT and taught me an important lesson &lt;code&gt;You can do anything if you know how to search on google&lt;/code&gt;. It made me start learning how to fix basic computer problems like troubleshooting internet connection or installing windows. After gaining all the knowledge, I start doing a part-time job fixing my friends/teacher computer and gain satisfaction from it, that's when I decide to defy everyone's hope of me becoming a doctor. And go into the IT world.&lt;/p&gt;

&lt;h3&gt;
  
  
  University
&lt;/h3&gt;

&lt;p&gt;Soon after graduation, I attended a 3 years IT degree in a private university which shocked me, &lt;code&gt;I never knew I need to CODE!&lt;/code&gt;. while everyone else had the basics of coding, I only knew how to fix internet issues on computers. On my first day, the lesson was about &lt;code&gt;variables&lt;/code&gt;, when the lecture explaining what is &lt;code&gt;string&lt;/code&gt;, I can only think of guitar string!. It comes to the realization that coding is an impossible thing for me. Then, I started to divert my path by joining a part-time job as a salesman and a technical assistant. I gave my best for non-coding theory related subject and nearly failed all of the coding subjects. I can barely pass because my friends helped me out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Internship
&lt;/h3&gt;

&lt;p&gt;2nd year of study without knowing how to code, the university sends the students for an internship as preparation before 3rd year. I barely pass the phone internship interview because I googled out the answers. I never saw in my life someone can actually code back then until I met this person called &lt;code&gt;R&lt;/code&gt; in the intern place. As an intern, he built a website in less than 2 hours &lt;code&gt;live&lt;/code&gt; in front of me for his freelance work. Soon we became friends and learn to code together, It was very hard on the first day to understand it. It gave me a severe headache and nosebleed at night that day learning the basics of HTML/CSS/js and a bit of ASP.net C# to build a simple form. The reason why I got motivated is that he showed the result of everything he taught in a real-life scenario, which was pretty cool. One thing he always said to me &lt;code&gt;Nothing is impossible here, so every error has a solution&lt;/code&gt;, taught me to not be afraid of getting errors on my code. From there onwards, I got an assignment from the company to build a signup/login form. I experimented with many things while building this form, especially the styles. because looking at the style changing keeps me motivated. but in the end, I failed to meet the deadlines and ends up transferring the assignment to someone else. Many assignments came after that, some success, and some failed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Post internship + Last year at university
&lt;/h3&gt;

&lt;p&gt;After 3 months of internship, I got used to HTML/CSS/js and CRUD concept in C#. My senior friend contacted me asking if I can make an e-commerce website for her. I did not ask for money nor anything at that time, my only aim was only to learn. I took the project, I asked &lt;code&gt;R&lt;/code&gt; for advice since I never got a project this big before. Instead of listening to lectures, I was busy coding in class. for some deadlines, I need to stay up late until seeing a sunrise. I stopped my part-time job at that time and focus just on completing the project. The most time consuming and also the most important learning process was &lt;code&gt;debugging errors&lt;/code&gt;, I encountered many errors and mistakes. &lt;code&gt;Searching errors on Google and reading the stack overflow question &amp;amp; answer properly&lt;/code&gt; was the real key to code. It's hard to read at first, but I kept forcing my brain to just read it. In the end, the project was completed after 3 months, even without getting anything, it was a life-changing project for me. The senior was happy and start spreading words to her friends, by then I started doing many freelance IT project, but that time, I started collecting money from them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Work
&lt;/h3&gt;

&lt;p&gt;Soon after graduation, I join a fintech company as a front-end developer. Here I studied coding best practices, better application architecture, new/latest frameworks, and development workflow in the workplace. I am inspired to write a blog after watching a youtube channel &lt;code&gt;Web programming Un pas&lt;/code&gt; to &lt;code&gt;share the knowledge and contribute to the community if you know how to code already&lt;/code&gt;. After this post, I wanted to try to post more useful articles related to coding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The hardest thing is to &lt;code&gt;start&lt;/code&gt;, and consistently doing it. To do that, you need to have a &lt;code&gt;career goal and project goal&lt;/code&gt;. It is easier to keep yourself motivated that way rather than learning it only just for the sake of learning it.&lt;br&gt;
&lt;strong&gt;e.g of career goal&lt;/strong&gt;: I want to work in company 'A' as a developer or I want to build a tech company or I want to have a good income from solving problems with the app I create. &lt;br&gt;
&lt;strong&gt;e.g of project goal&lt;/strong&gt;: I want to build a resume portfolio, I want to build an e-commerce app for my business&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start small. You do not need to create a big project at first, it will end up tiring yourself and get you overwhelmed. Instead, try small thing first, &lt;br&gt;
e.g: showing up hello world text to screen, creating a button and its types, create header navigation, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every little thing matters. Showing up &lt;code&gt;text&lt;/code&gt; to the screen or buttons might sound a little or a simple change, but in practice, it is not at all, especially for beginners. Appreciate yourself even by showing &lt;code&gt;Hello world&lt;/code&gt; to the screen or terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not confuse yourself too much with the environments at first.&lt;br&gt;
In case your goal is to show text on the screen.&lt;br&gt;
take this java code example:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void main(String[] args) {
        // Will print hello world
        System.out.print("Hello world");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I used to ask myself these questions: &lt;code&gt;What is System&lt;/code&gt; or &lt;code&gt;What is System.out do&lt;/code&gt; or &lt;code&gt;Why does it use string[] args&lt;/code&gt;. It is not wrong to ask these questions, but these will confuse you as beginners and as you confuse, you will lose motivation. We just have to stick to the goal &lt;code&gt;to show the text to the screen&lt;/code&gt;, so the real question to keep it simple is&lt;br&gt;
&lt;strong&gt;Which block of code is responsible for displaying my text&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System.out.print("ANYTHING INSIDE HERE");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Learn from having errors and mistakes. You will undoubtedly encounter errors, if possible have some friends/community to share your mistakes or errors, if not, google is your best friend. It's better to not jump straight to google or community first when having errors. because most of the errors caused by common mistakes like a typo, or missing symbols like a semicolon, colon, dot, or comma.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose your resources. This is the list of my resources&lt;br&gt;
&lt;strong&gt;youtube.com&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;codecademy.com&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;freecodecamp.org&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;udemy.com&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;etc&lt;/strong&gt;&lt;br&gt;
For starters, just follow what the tutorial says, you can follow exactly what it does, and after completing it, you can try to start creating something similar to it on your own, or working toward your goal.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for reading until this point. I hope you have a great day ahead. 😉 💪 💪&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>welcome</category>
      <category>tips</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
