<?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: Elabid Asmaa</title>
    <description>The latest articles on DEV Community by Elabid Asmaa (@elabid_asmaa).</description>
    <link>https://dev.to/elabid_asmaa</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%2F1783456%2F588b196a-2510-40e6-9f6e-707e8a6f0c84.jpg</url>
      <title>DEV Community: Elabid Asmaa</title>
      <link>https://dev.to/elabid_asmaa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/elabid_asmaa"/>
    <language>en</language>
    <item>
      <title>Cypress Interceptors (E2E Testing)</title>
      <dc:creator>Elabid Asmaa</dc:creator>
      <pubDate>Wed, 18 Mar 2026 00:48:51 +0000</pubDate>
      <link>https://dev.to/elabid_asmaa/cypress-interceptors-e2e-testing-1lc5</link>
      <guid>https://dev.to/elabid_asmaa/cypress-interceptors-e2e-testing-1lc5</guid>
      <description>&lt;p&gt;&lt;em&gt;cy.intercept()&lt;/em&gt; in Cypress allows you to spy on, modify, or mock HTTP requests during end-to-end tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is mainly used to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Prevent real API calls&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mock backend responses&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Control test scenarios&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wait for network requests before assertions&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Basic Syntax:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;intercept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;url&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;intercept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users&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="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This mocks the API response instead of calling the real backend.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Mocking API Responses
&lt;/h2&gt;

&lt;p&gt;Intercept can return a custom response.&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="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;intercept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users&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="na"&gt;fixture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;users.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;getUsers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This loads data from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cypress/fixtures/users.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Benefits:
&lt;/h3&gt;

&lt;p&gt;Stable tests&lt;/p&gt;

&lt;p&gt;Independent from backend availability&lt;/p&gt;

&lt;h2&gt;
  
  
  Modifying Requests
&lt;/h2&gt;

&lt;p&gt;You can change request data before it reaches the server.&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="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;intercept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/login&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="nx"&gt;req&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;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test-user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Use fixtures for reusable mock data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Always alias important requests with .as().&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Avoid intercepting too many endpoints to keep tests realistic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use intercepts mainly for network stability and deterministic tests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This makes E2E tests faster, deterministic, and independent from backend state.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>api</category>
      <category>javascript</category>
      <category>testing</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Watching Out for Watchers in Vue</title>
      <dc:creator>Elabid Asmaa</dc:creator>
      <pubDate>Wed, 11 Mar 2026 04:10:29 +0000</pubDate>
      <link>https://dev.to/elabid_asmaa/watching-out-for-watchers-in-vue-3pmg</link>
      <guid>https://dev.to/elabid_asmaa/watching-out-for-watchers-in-vue-3pmg</guid>
      <description>&lt;h2&gt;
  
  
  1. What is a Watcher?
&lt;/h2&gt;

&lt;p&gt;A watcher in Vue allows us to react to changes in reactive state.&lt;br&gt;
&lt;em&gt;Example:&lt;/em&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="nf"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newId&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="nf"&gt;fetchUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newId&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;When userId changes, the watcher runs the function.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Problem With Overusing Watchers
&lt;/h2&gt;

&lt;p&gt;Watchers are powerful but can easily be overused.&lt;/p&gt;

&lt;p&gt;Common issues:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;⚠️ Hidden logic&lt;/em&gt;&lt;br&gt;
  It becomes hard to understand what triggers what.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;⚠️ Debugging complexity&lt;/em&gt;&lt;br&gt;
  Many watchers can create chains of reactions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;⚠️ Performance issues&lt;/em&gt;&lt;br&gt;
  Deep watchers or multiple watchers may trigger frequently.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;⚠️ Unnecessary reactivity&lt;/em&gt;&lt;br&gt;
  Sometimes we watch values when we could compute them instead.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example of problematic code:&lt;/em&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="nf"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&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;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;b&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="nx"&gt;a&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="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;This is unnecessary because it should be a computed value.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Prefer Computed Over Watch When Possible
&lt;/h2&gt;

&lt;p&gt;If you are deriving state from other state, use computed.&lt;/p&gt;

&lt;p&gt;Computed properties are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;easier to understand&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;automatically optimized by Vue&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Simple Rule of Thumb
&lt;/h2&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;p&gt;🧠 computed → derived state&lt;br&gt;
👀 watch → side effects only&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you find yourself watching something just to update another reactive variable, it's probably the wrong approach.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>vue</category>
    </item>
    <item>
      <title>Understanding Vue Composables</title>
      <dc:creator>Elabid Asmaa</dc:creator>
      <pubDate>Wed, 11 Mar 2026 03:45:20 +0000</pubDate>
      <link>https://dev.to/elabid_asmaa/understanding-vue-composables-219k</link>
      <guid>https://dev.to/elabid_asmaa/understanding-vue-composables-219k</guid>
      <description>&lt;h2&gt;
  
  
  1. What is a Composable?
&lt;/h2&gt;

&lt;p&gt;In Vue 3, a composable is a stateful function that encapsulate reusable &lt;strong&gt;reactive logic&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A composable typically:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Uses Vue reactivity (ref, reactive, computed, watch)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Manages state&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can be reused across components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Usually follows the naming convention useSomething()&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&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;// useCounter.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;ref&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;vue&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;function&lt;/span&gt; &lt;span class="nf"&gt;useCounter&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;count&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;count&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="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;increment&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;h2&gt;
  
  
  2. What is NOT a Composable?
&lt;/h2&gt;

&lt;p&gt;If a function does not manage reactive state, then it is not a composable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;These should be utility functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&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="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;formatDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toLocaleDateString&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;&lt;strong&gt;This function:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Has no reactive state&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is pure logic&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So it shouldn't live in &lt;code&gt;composables/&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Mixins vs Store vs Composables (Vue)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Mixins
&lt;/h3&gt;

&lt;p&gt;Mixins were mainly used in Vue 2 to reuse component logic.&lt;/p&gt;

&lt;p&gt;They allow you to inject properties, methods, lifecycle hooks, and data into components.&lt;/p&gt;

&lt;h4&gt;
  
  
  Characteristics
&lt;/h4&gt;

&lt;p&gt;Reuse logic between components&lt;/p&gt;

&lt;p&gt;Automatically merges into component options&lt;/p&gt;

&lt;h4&gt;
  
  
  Problems with Mixins
&lt;/h4&gt;

&lt;p&gt;Mixins have several issues:&lt;/p&gt;

&lt;h5&gt;
  
  
  ⚠️Name collisions
&lt;/h5&gt;

&lt;p&gt;If a component and mixin define the same method or property.&lt;/p&gt;

&lt;h5&gt;
  
  
  ⚠️ Implicit dependencies
&lt;/h5&gt;

&lt;p&gt;Hard to know where data or methods come from.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Because of these issues, Vue 3 recommends composables instead of mixins.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Composables
&lt;/h3&gt;

&lt;p&gt;Composables are functions that encapsulate reusable reactive logic&lt;/p&gt;

&lt;h4&gt;
  
  
  Characteristics
&lt;/h4&gt;

&lt;p&gt;✅ Explicit imports&lt;br&gt;
  ✅ Reusable reactive logic&lt;br&gt;
  ✅ No name collisions&lt;br&gt;
  ✅ Clear data origin&lt;br&gt;
  ✅ Better TypeScript support&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Composables are the modern replacement for mixins.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Store
&lt;/h3&gt;

&lt;p&gt;The store is used for global shared state across the entire application.&lt;/p&gt;

&lt;p&gt;🌍 Global state management&lt;br&gt;
🔁 Shared between many components&lt;br&gt;
📦 Centralized data source&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple Rule of Thumb&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Use Composables ⚙️&lt;/em&gt;&lt;br&gt;
→ When reusing reactive logic across components&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use Store 🗂&lt;/em&gt;&lt;br&gt;
→ When state must be shared globally&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Avoid Mixins ⚠️&lt;/em&gt;&lt;br&gt;
→ Legacy pattern replaced by composables&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>vue</category>
    </item>
    <item>
      <title>Introducing date-formatter-i18n: Simplify i18n for Dates in JavaScript</title>
      <dc:creator>Elabid Asmaa</dc:creator>
      <pubDate>Fri, 10 Jan 2025 11:20:53 +0000</pubDate>
      <link>https://dev.to/elabid_asmaa/introducing-date-formatter-i18n-simplify-i18n-for-dates-in-javascript-32cm</link>
      <guid>https://dev.to/elabid_asmaa/introducing-date-formatter-i18n-simplify-i18n-for-dates-in-javascript-32cm</guid>
      <description>&lt;p&gt;As developers, we often deal with &lt;em&gt;dates&lt;/em&gt; in our applications, and it’s never as simple as it seems. What format should we use? How do we account for user locales? What about relative time like "3 days ago"?&lt;/p&gt;

&lt;p&gt;Introducing &lt;em&gt;&lt;strong&gt;date-formatter-i18n&lt;/strong&gt;&lt;/em&gt;, a lightweight &lt;em&gt;NPM package&lt;/em&gt; that makes &lt;em&gt;date formatting&lt;/em&gt; and &lt;em&gt;localization&lt;/em&gt; effortless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s what it offers:&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;📅 Date Formatting: Convert raw dates into readable formats across locales.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;⏳ Relative Time: Display times like "2 days ago" or "in 1 hour" dynamically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🌍 i18n Support: Easily switch between languages like English, French, and German.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Use This Library?
&lt;/h2&gt;

&lt;p&gt;Existing solutions can be heavy, complex, or lack proper i18n support. date-formatter-localized focuses on simplicity, making it perfect for multilingual apps.&lt;/p&gt;

&lt;p&gt;Here’s an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import DateFormatter from 'date-formatter-i18n';

// Create an instance of DateFormatter
const dateFormatter = new DateFormatter('en');

const formattedDate = dateFormatter.format('2023-12-25'); 
// Output: "December 25, 2023"

// Relative time
const pastDate = new Date(Date.now() - 3 * 24 * 60 * 60 * 1000);
console.log(dateFormatter.formatRelative(pastDate));
// Output: 3 days ago

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;

&lt;p&gt;To install:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install date-formatter-localized&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Contribute
&lt;/h2&gt;

&lt;p&gt;Want to add more locales or features? Head over to the &lt;a href="https://github.com/asmaelabid/date-formatter-i18n" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt; and contribute!&lt;/p&gt;

&lt;p&gt;If you find it helpful, please &lt;strong&gt;star ⭐ the repository&lt;/strong&gt; to show your support!&lt;/p&gt;

&lt;p&gt;Let’s make date formatting smarter, simpler, and more global. 🌐&lt;/p&gt;

</description>
      <category>i18n</category>
      <category>npm</category>
      <category>javascript</category>
      <category>localization</category>
    </item>
    <item>
      <title>Supercharge Your Project Documentation: Introducing project-readme-gen – An AI-Powered README Generator</title>
      <dc:creator>Elabid Asmaa</dc:creator>
      <pubDate>Mon, 30 Dec 2024 06:34:37 +0000</pubDate>
      <link>https://dev.to/elabid_asmaa/supercharge-your-project-documentation-introducing-project-readme-gen-an-ai-powered-readme-4hhg</link>
      <guid>https://dev.to/elabid_asmaa/supercharge-your-project-documentation-introducing-project-readme-gen-an-ai-powered-readme-4hhg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Effortlessly create professional and comprehensive README files for your projects using the power of AI.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;“We’ve all been there: staring at a blank README file, wondering where to start. Whether you’re a solo developer or managing an open-source project, writing a great README is often the last thing on your mind. Enter project-readme-gen – a command-line tool that simplifies documentation creation by leveraging AI. Let’s dive into how this tool can transform the way you document your projects."&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AI-Driven Content: Combines OpenAI’s GPT and Google’s Gemini APIs for tailored and natural README content.&lt;/li&gt;
&lt;li&gt;Ease of Use: A simple CLI tool with minimal setup.&lt;/li&gt;
&lt;li&gt;Customizable: Automatically analyzes your project’s structure for a personalized README.&lt;/li&gt;
&lt;li&gt;Time-Saving: Skip hours of manual writing and editing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Good Documentation Matters:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Improve onboarding for teams.&lt;/li&gt;
&lt;li&gt;First impressions count.&lt;/li&gt;
&lt;li&gt;Attract contributors to open-source projects.&lt;/li&gt;
&lt;li&gt;Build trust with users.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Getting Started with project-readme-gen
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Installation :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g project-readme-gen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Setup:
Configure your API keys in a .env file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OPENAI_API_KEY=your-openai-key
GEMINI_API_KEY=your-gemini-key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Generate Your README:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project-readme-gen /path/to/your/project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;u&gt;Example Output:&lt;br&gt;
&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zzsoteulhxop3gxgj7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zzsoteulhxop3gxgj7e.png" alt="readme generator output example" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Under the Hood:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Built using Node.js with popular libraries like commander, fs-extra, and glob.&lt;/li&gt;
&lt;li&gt;Integrates with AI models for context-aware content generation.&lt;/li&gt;
&lt;li&gt;Designed for scalability and ease of customization.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Support for multiple languages.&lt;/li&gt;
&lt;li&gt;Enhanced project analysis for more tailored content.&lt;/li&gt;
&lt;li&gt;Integration with CI/CD workflows.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;ul&gt;
&lt;li&gt;Saves time and boosts productivity.&lt;/li&gt;
&lt;li&gt;Makes high-quality documentation accessible to all.&lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;“Ready to level up your documentation game? Install project-readme-gen today and create your first AI-powered README in seconds!"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/project-readme-gen" rel="noopener noreferrer"&gt;Readme Gen npm package page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/asmaelabid/project-readme-gen" rel="noopener noreferrer"&gt;Readme Gen github repository&lt;/a&gt;&lt;/p&gt;

</description>
      <category>readmegenerator</category>
      <category>automation</category>
      <category>documentation</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
