<?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: BennoDev</title>
    <description>The latest articles on DEV Community by BennoDev (@bennodev19).</description>
    <link>https://dev.to/bennodev19</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%2F632116%2F0faed4ca-6276-478b-8ee3-e039c3fdd8b5.jpg</url>
      <title>DEV Community: BennoDev</title>
      <link>https://dev.to/bennodev19</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bennodev19"/>
    <language>en</language>
    <item>
      <title>[!] RollupError: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" ..</title>
      <dc:creator>BennoDev</dc:creator>
      <pubDate>Fri, 07 Jul 2023 06:53:17 +0000</pubDate>
      <link>https://dev.to/bennodev19/-rolluperror-invalid-value-for-option-outputfile-when-building-multiple-chunks-the-outputdir--267n</link>
      <guid>https://dev.to/bennodev19/-rolluperror-invalid-value-for-option-outputfile-when-building-multiple-chunks-the-outputdir--267n</guid>
      <description>&lt;h3&gt;
  
  
  Issue
&lt;/h3&gt;

&lt;p&gt;When using Rollup for bundling JavaScript code, if your code includes dynamic imports (using the &lt;code&gt;import()&lt;/code&gt; function), Rollup treats them as separate chunks. Therefore, Rollup expects to output these chunks into a directory instead of a single file.&lt;/p&gt;

&lt;p&gt;If your Rollup configuration is set to output to a single file (using the &lt;code&gt;output.file&lt;/code&gt; option), it will throw an error when encountering dynamic imports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[!] RollupError: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;There are two main ways to solve this issue:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;output.dir&lt;/code&gt; instead of &lt;code&gt;output.file&lt;/code&gt;&lt;/strong&gt;: If you are okay with having multiple chunks as output, you can configure Rollup to output to a directory instead of a single file. This will allow Rollup to create multiple chunk files for each dynamic import.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./dist&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;format&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;es&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;sourcemap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isProduction&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;ol&gt;
&lt;li&gt;
&lt;strong&gt;Inline dynamic imports&lt;/strong&gt;: If you want a single file as output but also have dynamic imports in your code, you can set the &lt;code&gt;inlineDynamicImports&lt;/code&gt; option to &lt;code&gt;true&lt;/code&gt; in your Rollup configuration. This will inline all dynamic imports into the single output file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./dist/bundle.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;format&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;es&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;sourcemap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isProduction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;inlineDynamicImports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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;Please note, when &lt;code&gt;inlineDynamicImports&lt;/code&gt; is true, Rollup can only be used for single-entry point bundles.&lt;/p&gt;

&lt;p&gt;Keep in mind, these solutions might require further adjustments in your codebase or build process, depending on the specific requirements of your project.&lt;/p&gt;

</description>
      <category>rollup</category>
      <category>javascript</category>
      <category>bundler</category>
    </item>
    <item>
      <title>createState("Introducing AgileTs. A flexible State-Manager");</title>
      <dc:creator>BennoDev</dc:creator>
      <pubDate>Tue, 27 Jul 2021 09:51:29 +0000</pubDate>
      <link>https://dev.to/bennodev19/createstate-introducing-agilets-a-flexible-state-manager-91f</link>
      <guid>https://dev.to/bennodev19/createstate-introducing-agilets-a-flexible-state-manager-91f</guid>
      <description>&lt;p&gt;One of the most challenging problems to solve, especially in large frontend applications, is managing global States. While there are already several excellent approaches to solving global state management problems, most are tied to a specific workflow. You are often forced to define everything in a single source-of-truth store object, which takes away a lot of flexibility and simplicity. However, have you ever thought about managing your States as global individuals (&lt;code&gt;atoms&lt;/code&gt;) that can be structured as preferred and dynamically bound to any UI-Component for reactivity?&lt;/p&gt;

&lt;p&gt;I'm very excited to introduce you to &lt;a href="https://agile-ts.org/" rel="noopener noreferrer"&gt;AgileTs&lt;/a&gt;. &lt;strong&gt;A straightforward, flexible, well-tested State Management Library for Javascript/Typescript applications.&lt;/strong&gt; AgileTs enables the straightforward creation of individual and independent States (&lt;code&gt;createState('Hello World');&lt;/code&gt;) while providing a powerful toolset focused on developer experience around those States.&lt;/p&gt;

&lt;p&gt;The flexibility provided by managing global States as individuals makes AgileTs suitable for both, developers building smaller applications (&lt;a href="https://agile-ts.org/docs/style-guide#-inspiration-1" rel="noopener noreferrer"&gt;Style Guide&lt;/a&gt;) worrying about writing too much boilerplate code. And for teams creating large applications (&lt;a href="https://agile-ts.org/docs/style-guide#-inspiration-2" rel="noopener noreferrer"&gt;Style Guide&lt;/a&gt;) trying to create readable, maintainable, and testable code.  &lt;/p&gt;

&lt;p&gt;Before we dive into a small example, it should be noted that there is no 'perfect' way of managing global States. Each State Management approach has &lt;strong&gt;benefits&lt;/strong&gt; and &lt;strong&gt;drawbacks&lt;/strong&gt;. Depending on the kind of application you are building and your preferred code style, you should weigh which State-Management-Library is best suited for your needs. &lt;strong&gt;More on the benefits and drawbacks of AgileTs later.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;‎ &lt;/p&gt;

&lt;h2&gt;
  
  
  👨‍💻 Get started with React and AgileTs
&lt;/h2&gt;

&lt;p&gt;Let's see how AgileTs works with React. To demonstrate its basic capabilities, I will show you how to build a simple application using AgileTs and React. The sample project we'll look at is a small counter that lets us increase a number as we click the 'Update State' button. It may not be fascinating, but it shows all the essential pieces of a React + AgileTs application in action.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/agilets-first-state-f12cz"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ Installation
&lt;/h3&gt;

&lt;p&gt;Installing AgileTs is as straightforward as installing any other npm packages. First, let’s install it using either &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&lt;/code&gt;. To properly work with AgileTs in a React environment, we need to add &lt;strong&gt;two different packages&lt;/strong&gt; to our existing React application.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;😎  If you want to set up a project from scratch, you can also use the official &lt;code&gt;create-react-app&lt;/code&gt; template for AgileTs.&lt;/p&gt;


&lt;pre class="highlight typescript"&gt;&lt;code&gt;
   &lt;span class="c1"&gt;// Javascript&lt;/span&gt;
   &lt;span class="nx"&gt;npx&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt; &lt;span class="nx"&gt;agile&lt;/span&gt;

   &lt;span class="c1"&gt;// Typescript&lt;/span&gt;
   &lt;span class="nx"&gt;npx&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt; &lt;span class="nx"&gt;agile&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;typescript&lt;/span&gt;

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

&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  📁 &lt;code&gt;@agile-ts/core&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @agile-ts/core 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://agile-ts.org/docs/core" rel="noopener noreferrer"&gt;&lt;code&gt;core&lt;/code&gt;&lt;/a&gt; package contains the state management logic of AgileTs and therefore offers powerful classes such as the &lt;a href="https://agile-ts.org/docs/core/state" rel="noopener noreferrer"&gt;&lt;code&gt;State Class&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  📂 &lt;code&gt;@agile-ts/react&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @agile-ts/react 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://agile-ts.org/docs/react" rel="noopener noreferrer"&gt;React Integration&lt;/a&gt;, on the other hand, is an interface to React and provides useful functions like the &lt;a href="https://agile-ts.org/docs/react/hooks#useagile" rel="noopener noreferrer"&gt;&lt;code&gt;useAgile()&lt;/code&gt;&lt;/a&gt; Hook to easily bind States to React Components for reactivity.&lt;/p&gt;

&lt;h3&gt;
  
  
  2️⃣ Create State
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MY_FIRST_STATE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&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;After we have successfully installed AgileTs, we can start creating our first independent AgileTs State. All you need to instantiate a State is to call &lt;code&gt;createState()&lt;/code&gt; and specify an initial value.&lt;br&gt;
In our example, we have assigned the initial value 'Hello World' to the State. If you are wondering why we write AgileTs States uppercase. Well, it has a simple advantage. We can easily differentiate between global and local States in our UI-Components (See Step 3️⃣).&lt;/p&gt;
&lt;h3&gt;
  
  
  3️⃣ Bind initialized State to a React-Component
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;RandomComponent&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myFirstState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useAgile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;MY_FIRST_STATE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;-&lt;/span&gt;

    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myFirstState&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&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;p&gt;Here (&lt;code&gt;// &amp;lt;-&lt;/code&gt;) we bind our just created State to the React Component ('RandomComponent') using the &lt;a href="https://agile-ts.org/docs/react/hooks#useagile" rel="noopener noreferrer"&gt;&lt;code&gt;useAgile()&lt;/code&gt;&lt;/a&gt; Hook. This binding ensures that the Component re-renders whenever the State &lt;code&gt;value&lt;/code&gt; mutates. The &lt;code&gt;useAgile()&lt;/code&gt; Hook returns the current &lt;code&gt;value&lt;/code&gt; of the State. So in our case, something like 'Hello World'.&lt;/p&gt;
&lt;h3&gt;
  
  
  4️⃣ Update State value
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt; &lt;span class="nx"&gt;MY_FIRST_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello World &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="nx"&gt;helloWorldCount&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To bring some life into our small application, we update the State &lt;code&gt;value&lt;/code&gt; with the help of the State's &lt;code&gt;.set()&lt;/code&gt; function on each 'Update State' button press. Thereby we increase the external set  &lt;code&gt;helloWorldCount&lt;/code&gt; in ascending order.&lt;/p&gt;
&lt;h2&gt;
  
  
  😎 Everything put together
&lt;/h2&gt;

&lt;p&gt;Here we see the whole counter-example in one piece.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 2️⃣ Create State with the initial value "Hello World"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MY_FIRST_STATE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&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;helloWorldCount&lt;/span&gt; &lt;span class="o"&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;const&lt;/span&gt; &lt;span class="nx"&gt;RandomComponent&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;// 3️⃣ Bind initialized State to the 'RandomComponent' for reactivity&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myFirstState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useAgile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;MY_FIRST_STATE&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&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;p&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;myFirstState&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;/p&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;onClick&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;// 4️⃣ Update State value on Button press&lt;/span&gt;
                    &lt;span class="nx"&gt;MY_FIRST_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello World &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="nx"&gt;helloWorldCount&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;gt;&lt;/span&gt;
                &lt;span class="nx"&gt;Update&lt;/span&gt; &lt;span class="nx"&gt;State&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;/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;p&gt;If you are eager to learn more about AgileTs, take a look at our &lt;a href="https://agile-ts.org/docs/quick-start/react" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;‎ &lt;/p&gt;

&lt;h2&gt;
  
  
  👨‍💻 Get started with [x] and AgileTs
&lt;/h2&gt;

&lt;p&gt;Unfortunately, this blog post can't cover how to use AgileTs in other frontend frameworks than React, as that would be beyond the scope. However, the core principle of AgileTs is in each UI-Framework the same. The only part that might differ is how to bind States to UI-Components for reactivity (Step 3️⃣). &lt;/p&gt;

&lt;p&gt;Here are code sandboxes for each already supported UI-Framework with the same &lt;code&gt;counter-example&lt;/code&gt; as in the React example section above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codesandbox.io/s/agilets-first-state-f12cz" rel="noopener noreferrer"&gt;React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://snack.expo.io/@bennodev/agilets-first-state" rel="noopener noreferrer"&gt;React-Native&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://codesandbox.io/s/agilets-first-state-i5xxs" rel="noopener noreferrer"&gt;Vue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;‎ &lt;/p&gt;

&lt;h2&gt;
  
  
  ⚛️ Is AgileTs an &lt;code&gt;atomic&lt;/code&gt; State Manager?
&lt;/h2&gt;

&lt;p&gt;Yes, AgileTs follows the same pattern as &lt;code&gt;atomic&lt;/code&gt; State Management Libraries like &lt;a href="https://recoiljs.org/" rel="noopener noreferrer"&gt;Recoil&lt;/a&gt;. States in AgileTs are created individually and lay above the UI-Layer, while they can be dynamically bound to any UI-Component (for example via Hooks).&lt;br&gt;
In AgileTs, States are not called atoms, but rather individual or perhaps singleton States. However, the main difference to Recoil is that AgileTs doesn't depend on React, can be used outside the React-Tree, is more feature-rich and beginner-friendly.&lt;/p&gt;

&lt;p&gt;‎ &lt;/p&gt;
&lt;h2&gt;
  
  
  👍 What makes AgileTs so special?
&lt;/h2&gt;

&lt;p&gt;After our little excursion on how AgileTs works in React, we already understand its basic API and functionality. So let's talk about what exactly makes AgileTs so special and some benefits of using it.&lt;/p&gt;
&lt;h3&gt;
  
  
  🚅 Straightforward
&lt;/h3&gt;

&lt;p&gt;As you may have noticed in the React example above,&lt;br&gt;
the API of AgileTs is fairly easy to understand and self-explaining. This is no coincidence; AgileTs is designed to write minimalistic, boilerplate-free code that captures your intent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Update State value to 'hi'&lt;/span&gt;
&lt;span class="nx"&gt;MY_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 

&lt;span class="c1"&gt;// Undo latest State value change&lt;/span&gt;
&lt;span class="nx"&gt;MY_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;undo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Check if the State value is equal to '{hello: "jeff"}'&lt;/span&gt;
&lt;span class="nx"&gt;MY_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jeff&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt; 

&lt;span class="c1"&gt;// Reset State to its intial value&lt;/span&gt;
&lt;span class="nx"&gt;MY_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reset&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 

&lt;span class="c1"&gt;// Preserves the State `value`  in the corresponding external Storage&lt;/span&gt;
&lt;span class="nx"&gt;MY_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;persist&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 

&lt;span class="c1"&gt;// Update State value in 200ms intervals&lt;/span&gt;
&lt;span class="nx"&gt;MY_STATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;interval&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="o"&gt;=&amp;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="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🤸‍ Flexible
&lt;/h3&gt;

&lt;p&gt;In AgileTs, States are created detached from each other and have an independent existence. Think of AgileTs States as global variables that can be structured as preferred and dynamically bound to any UI-Component. AgileTs States are partly like UI-Components since UI-Components are also just global variables embedded in other UI-Components.&lt;br&gt;
&lt;a href="https://media.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%2Fjszrz2lsl12l3zd6dybq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fjszrz2lsl12l3zd6dybq.png" alt="image"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The given flexibility has a lot of advantages. However, the capability to initialize States everywhere might lead to an unstructured and not transparent application, which quickly ends in a mess. To help you not to end up there, we have created some &lt;a href="https://agile-ts.org/docs/style-guide" rel="noopener noreferrer"&gt;Style Guides&lt;/a&gt; to give you some inspiration on how to structure a frontend application using AgileTs.&lt;/p&gt;
&lt;h3&gt;
  
  
  🐻 Powerful State extensions
&lt;/h3&gt;

&lt;p&gt;Based on the functionality of the basic AgileTs State, we have created further helpful classes, such as:&lt;/p&gt;
&lt;h4&gt;
  
  
  👨‍🏫 &lt;a href="https://agile-ts.org/docs/core/computed" rel="noopener noreferrer"&gt;Computed State&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Computed States are a powerful concept that lets us build dynamic data depending on other data. To avoid unnecessary recomputations, the Computed Class caches the computed value and recomputes it only when an actual dependency has changed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;INTRODUCTION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createComputed&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;return&lt;/span&gt; &lt;span class="s2"&gt;`Hello I am '&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;MY_NAME&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vale&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;p&gt;A Computed magically tracks used dependencies (such as States) and automatically recomputes when one of its dependencies updates. In the above code snippet, it would, for example, recompute when the current value of &lt;code&gt;MY_NAME&lt;/code&gt; changes from 'jeff' to 'hans'.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;INTRODUCTION&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="c1"&gt;// Returns "Hello I am 'jeff'."&lt;/span&gt;
&lt;span class="nx"&gt;MY_NAME&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hans&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;INTRODUCTION&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="c1"&gt;// Returns "Hello I am 'hans'."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://codesandbox.io/s/agilets-first-computed-kisgr" rel="noopener noreferrer"&gt;Sandbox&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  👨‍👩‍👧 &lt;a href="https://agile-ts.org/docs/core/collection/" rel="noopener noreferrer"&gt;Collection State&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Collection States come in handy when managing a set of information, such as a list of todos or users. A Collection is specially designed for arrays of &lt;code&gt;data objects&lt;/code&gt; following the same pattern. Each of these data objects requires a unique &lt;code&gt;item key&lt;/code&gt; to be correctly identified later. Think of a Collection like a database table that stores a data object once keyed by an id (&lt;code&gt;item key&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;JOKES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createCollection&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, we've created a Collection that stores a list of Jokes. However, a joke list without jokes isn't funny.&lt;br&gt;
So let's add a funny joke to our newly created Joke Collection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;JOKES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collect&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;joke&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Why do Java programmers have to wear glasses?&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt; 
         Because they don't C#&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;programming&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;The joke we've just added belongs to the category 'Programming'. Therefore we categorize it to the &lt;code&gt;programming&lt;/code&gt; Group. Groups allow us to easily cluster together data from a Collection as an array of item keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;JOKES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getGroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;chucknorris&lt;/span&gt;&lt;span class="dl"&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="c1"&gt;// Returns Chuck Norris Jokes&lt;/span&gt;
&lt;span class="nx"&gt;JOKES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getGroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;programming&lt;/span&gt;&lt;span class="dl"&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="c1"&gt;// Returns Programming Jokes&lt;/span&gt;
&lt;span class="nx"&gt;JOKES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDefaultGroup&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="c1"&gt;// Returns All Jokes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://codesandbox.io/s/agilets-first-collection-uyi9g" rel="noopener noreferrer"&gt;Sandbox&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀 Enhance Performance
&lt;/h3&gt;

&lt;p&gt;AgileTs assures performance optimization by batching re-render jobs and only re-rendering the UI-Components when an actual bound State mutates. You can go even further by only binding particular properties of a State value to the UI-Component or using the inbuilt &lt;a href="https://agile-ts.org/docs/react/hooks#useproxy" rel="noopener noreferrer"&gt;proxy functionality&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Component re-renders only when 'user.name' mutates&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;MY_USER&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;value&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&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="c1"&gt;// Returns 'jeff'&lt;/span&gt;

&lt;span class="c1"&gt;// Component re-renders only when 'user.age' mutates&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useProxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;MY_USER&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Returns '8'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🐞 Easy debugging
&lt;/h3&gt;

&lt;p&gt;AgileTs has no advanced &lt;code&gt;dev tools&lt;/code&gt; yet.&lt;br&gt;
However, you can bind your States to the &lt;code&gt;globalThis&lt;/code&gt;&lt;br&gt;
and easily access them in the browser console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MY_STATE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jeff&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;MY_COLLECTION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createCollection&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nf"&gt;globalBind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;__core__&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;MY_STATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MY_COLLECTION&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows you to preview and edit your global bound States at runtime. For example, the &lt;code&gt;core&lt;/code&gt; of the &lt;a href="https://agile-ts.org/" rel="noopener noreferrer"&gt;AgileTs documentation&lt;/a&gt; is globally bound for better debugging. &lt;a href="https://media.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%2Fj71x7d38045ap6qsdznf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fj71x7d38045ap6qsdznf.png" alt="image"&gt;&lt;/a&gt; Note that you should avoid attaching your application States to the &lt;code&gt;globalThis&lt;/code&gt; in &lt;strong&gt;production&lt;/strong&gt; because then third parties can easily interfere in your internal application logic. Since the AgileTs documentation has no vulnerable logic under the hood, the &lt;code&gt;core&lt;/code&gt; is also accessible in production. Thus you can play around with the AgileTs documentation &lt;code&gt;core&lt;/code&gt; and, for example, update the &lt;code&gt;NPM_DOWNLOADS&lt;/code&gt; State or update the astronaut color.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;__core__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NPM_DOWNLOADS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;999999&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;‎ &lt;/p&gt;

&lt;h2&gt;
  
  
  👎 Disadvantages of using AgileTs?
&lt;/h2&gt;

&lt;p&gt;Like any other great global State Manager, also AgileTs comes with some drawbacks that we should talk about. We are working hard to reduce and get rid of these. If you have any further concerns about using AgileTs, let me know in the comments. Then I can list them here and maybe even counteract them 😁. Thanks for your support.&lt;br&gt;
&lt;a href="https://media.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%2Fcil44rnwm8g1pnkew2ma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcil44rnwm8g1pnkew2ma.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🐘 Big bundle size
&lt;/h3&gt;

&lt;p&gt;Most State-Manager are pretty lightweight, but not this one. AgileTs has a minified size of &lt;a href="https://bundlephobia.com/result?p=@agile-ts/core" rel="noopener noreferrer"&gt;58.3kB&lt;/a&gt; (tree shaken 18kB) and is pretty heavy compared to its fellows. However, it offers a 100% type safety, a predictable runtime, an API focusing on developer experience, and much more in return. The large bundle size doesn't mean that AgileTs slows down your application noticeably. Convince yourself with the below listed AgileTs stress tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://codesandbox.io/s/agilets-large-state-pyo63" rel="noopener noreferrer"&gt;Large State (React)&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://codesandbox.io/s/agilets-frequent-updates-5tprm" rel="noopener noreferrer"&gt;Frequent Updates (React)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have also created some &lt;a href="https://github.com/agile-ts/agile/tree/master/benchmark" rel="noopener noreferrer"&gt;benchmarks&lt;/a&gt; that compare different State Management approaches in terms of performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌍 No large community
&lt;/h3&gt;

&lt;p&gt;AgileTs hasn't been officially released until now (July 2021)&lt;br&gt;
and I've not managed to build a community around the library yet. This was mainly because I thought AgileTs was not yet good enough to be shown to anyone. But well, among many other things I've learned while developing AgileTs, I've also learned that it's never too early to ask for feedback. 😅&lt;/p&gt;

&lt;p&gt;If you want to become a part of the AgileTs community, don't hesitate to join our &lt;a href="https://discord.gg/T9GzreAwPH" rel="noopener noreferrer"&gt;Community Discord&lt;/a&gt;. There you can ask anything related to AgileTs or programming in general and tell us what you think about AgileTs or what we can do better.  &lt;/p&gt;

&lt;h3&gt;
  
  
  🌲 Only one contributor/maintainer
&lt;/h3&gt;

&lt;p&gt;It may be strange, but if I (the only contributor) get hit by a tree or something and die, AgileTs will no longer have a maintainer. I've tried to create a as contributor-friendly codebase as possible. But still, it doesn't matter how many people are able to understand the code and fix the issues that might occur if no one can merge/release those changes.&lt;/p&gt;

&lt;p&gt;‎ &lt;/p&gt;

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

&lt;p&gt;In conclusion, AgileTs provides a simple yet powerful API that focuses on developer experience and meets the need for small and large applications by being scalable without writing any boilerplate code. Therefore, AgileTs looks to be an excellent candidate to consider for State Management. Although it is not lightweight, it tries to optimize the performance of our applications wherever it can by batching re-renders and offering proxy-based functionalities like the &lt;a href="https://agile-ts.org/docs/react/hooks#useproxy" rel="noopener noreferrer"&gt;&lt;code&gt;useProxy()&lt;/code&gt;&lt;/a&gt; hook.&lt;/p&gt;

&lt;p&gt;At last, thanks for taking the time to read this article. I would appreciate hearing what you think about AgileTs in the comments.  In case you have any further questions, don't hesitate to join our &lt;a href="https://discord.gg/T9GzreAwPH" rel="noopener noreferrer"&gt;Community Discord&lt;/a&gt; or ask on our &lt;a href="https://www.reddit.com/r/AgileTs/" rel="noopener noreferrer"&gt;subreddit&lt;/a&gt;. We are eager to help. And if you like the concept of AgileTs or/and want to support us, give us a ⭐️ (star) on &lt;a href="https://github.com/agile-ts/agile" rel="noopener noreferrer"&gt;Github&lt;/a&gt; and share it with your friends. Thanks for your support 😊&lt;/p&gt;

&lt;p&gt;Cheers 🎉&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Github: &lt;a href="https://github.com/agile-ts/agile" rel="noopener noreferrer"&gt;https://github.com/agile-ts/agile&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Website: &lt;a href="https://agile-ts.org/" rel="noopener noreferrer"&gt;https://agile-ts.org/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Discord: &lt;a href="https://discord.gg/T9GzreAwPH" rel="noopener noreferrer"&gt;https://discord.gg/T9GzreAwPH&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Twitter: &lt;a href="https://twitter.com/AgileTypescript" rel="noopener noreferrer"&gt;https://twitter.com/AgileTypescript&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Reddit: &lt;a href="https://www.reddit.com/r/AgileTs/" rel="noopener noreferrer"&gt;https://www.reddit.com/r/AgileTs/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
