<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ahmed Bouhuolia on Medium]]></title>
        <description><![CDATA[Stories by Ahmed Bouhuolia on Medium]]></description>
        <link>https://medium.com/@a.bouhuolia?source=rss-2d145997d2cb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GBjJRhRoVbbO5wEWsmmABg.png</url>
            <title>Stories by Ahmed Bouhuolia on Medium</title>
            <link>https://medium.com/@a.bouhuolia?source=rss-2d145997d2cb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 18 May 2026 11:46:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a.bouhuolia/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Announcing Bigcapital]]></title>
            <link>https://medium.com/@a.bouhuolia/introducing-bigcapital-95b02588f314?source=rss-2d145997d2cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/95b02588f314</guid>
            <category><![CDATA[accounting]]></category>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[core-accounting]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Ahmed Bouhuolia]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 23:00:22 GMT</pubDate>
            <atom:updated>2024-07-15T09:23:38.342Z</atom:updated>
            <content:encoded><![CDATA[<h4>Modern, Open-Source and Self-hosted Core Accounting Software</h4><p><em>We’re building core accounting software, with enjoyable modern user-experience, efficient financial statements and KPIs and more workflow automation. — </em><a href="https://bigcapital.app">Bigcapital.app</a></p><p>Managing the finance of any organization is a crucial activity for business owners and accountants. Most accountants automate their repetitive tasks by software, covering areas such as A/R, A/P, transaction categorization, syncing transactions from different apps, and closing books to ensure accurate financial statements.</p><p>This is why accounting software is still one of the oldest and most popular types of software created. Many leading software solutions on the market were developed over a decade ago using old technologies, and the core accounting have not evolved significantly since then, despite tremendous evolvement in A/R, A/P, and payroll technologies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mf6EKo7sOGHE4Vu-Q17-QQ.png" /><figcaption>P/L Statement</figcaption></figure><p><strong><em>What makes Bigcapital vastly superior to others:</em></strong></p><ul><li><strong>Deliver an exceptional user-experience</strong>, by prioritizing application performance and UI/UX, that kind of tool suppose to be used multiple times a day from business owners and accountants who support other businesses. should be a simple and fast to navigate.</li><li><strong>Better financial statements, reports and analysis KPIs</strong>, the best accountant software that gives top executives the concluded image about the current organization financial position for making better and faster decisions through realtime reports.</li><li><strong>Automate the manual tasks and optimize the workflow, </strong>one of the daily critical accountant tasks categorize the transactions that coming from bank accounts and credit cards, sending invoice reminders, etc. that kind of daily tasks can easily automated programmatically or AI.</li><li><strong>Integration with other systems</strong>, ability to integrate the accounting software with other sales, payments, bank accounts and credit cards to sync transactions automatically to the backbone accounting system, This automation significantly reduces the effort required by accountants to close books and ensures accuracy in financial records.</li><li><strong>Self-hosted &amp; Cloud Accounting,</strong> let users host their data on their own servers and develop additional features and integrations based on the core functionalities. Bigcapital Cloud offers the convenience of using and accessing financial data without worrying about infrastructure setup.</li></ul><p><a href="https://bigcapital.app"><strong>Bigcapital Cloud</strong></a> is the easiest way to run Bigcapital. <a href="https://my.bigcapital.app/auth/register">Sign up</a> and shareyour feedback with us through our <a href="https://discord.com/invite/c8nPBJafeb">community</a>.</p><p>You can also install and self-host Bigcapital Community yourself since it is <a href="https://github.com/bigcapitalhq/bigcapital">open-source</a>. With 2,300+ GitHub stars, Find the <a href="https://docs.bigcapital.app/deployment/docker#upgrading">instructions</a>.</p><p><em>— Ahmed Bouhuolia, CEO &amp; Founder of Bigcapital</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95b02588f314" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Controlled & Uncontrolled React Components]]></title>
            <link>https://medium.com/@a.bouhuolia/controlled-uncontrolled-react-components-e6eda64f2e1c?source=rss-2d145997d2cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6eda64f2e1c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Ahmed Bouhuolia]]></dc:creator>
            <pubDate>Thu, 15 Dec 2022 15:00:59 GMT</pubDate>
            <atom:updated>2022-12-15T15:07:13.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPqNgvpJ3PyMiokVfGByAQ.png" /><figcaption>Controlled &amp; Uncontrolled React Components</figcaption></figure><p><strong><em>Digging deep inside the stateless and stateful React components.</em></strong></p><blockquote>If you have been using React some of the time you must have heard about controlled and uncontrolled components.</blockquote><p>As we know there are two directions for state flowing between components the down-to-up and up-to-down.</p><p>The down-to-up (from child to parent component) is more straightforward and always can be done by callbacks, the down component triggers a callback and the up component listens to it.</p><p>The up-to-down direction (from parent to child component) can be done by passing the state to the prop of the child component, once you mutate that state, the behavior of the child component should change, that might be a bit tricky than the first one.</p><h3>Controlled Component.</h3><p>The controlled component is the component that its main state is controlled from outside.</p><p>Technically is the component that takes its current value through props and triggers changes through callbacks like onChange.</p><p>A parent component “controls” it by handling the callback and managing its own state and passing the new values as props to the controlled component. You could also call this a “<em>dumb component</em>”.</p><h4><strong>Example</strong></h4><p>Here’s a working code of a controlled component where we have displayed text.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/316003690bbcae55fa4ddd25127c5b4b/href">https://medium.com/media/316003690bbcae55fa4ddd25127c5b4b/href</a></iframe><p>Let’s understand the important aspects of controlled components from this example —</p><ul><li>When the input change occurs, the input element fires the event handler onChange and passes the new value of the text input.</li><li>The external component receives that new value through onChange listener and and passes the new value to the parent component state.</li><li>Then the parent component which is ParentComponent passes the new state to the child, because the displayed message comes from parent state.</li></ul><p>The state flow is unidirectional from the component with external components.</p><blockquote>You can call it a Stateless component because the component doesn’t store or hold the main state inside it and is state-controlled from the outside.</blockquote><h3><strong>Uncontrolled Component.</strong></h3><p>An Uncontrolled Component is one that stores its own state internally.</p><p>Usually, that type of component has initialValue prop just for passing the initial value of the state in the first rendering, but won’t be able to control the internal stored state in the further mutations.</p><p><strong>Example</strong></p><p>Here’s a working code of an uncontrolled component where we have displayed text.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27a125b1e55f6f06c277bb570beb0f57/href">https://medium.com/media/27a125b1e55f6f06c277bb570beb0f57/href</a></iframe><p>If you look at the code the state flowing as the following.</p><ul><li>The initialValue prop just for initial value of value state, if you mutated that state from outside the value state won’t change.</li><li>The parent component can listen the child component by onChange and the callback passes the new value of the child component.</li></ul><blockquote><em>An </em><strong><em>Uncontrolled Component</em></strong><em> should be a </em><strong><em>Stateful </em></strong><em>because the component stores and holds the main state inside and the main state is uncontrollable from the outside.</em></blockquote><h3>Controlled &amp; Uncontrolled Component.</h3><p>If you have gone through controlled and uncontrolled component you may have already guessed when we should use controlled or uncontrolled component, actually that depends on the use-case of that component.</p><p>It’s preferable to build components to be controllable and uncontrollable at the same time out-of-the-box, which will give flexibility to the end user to choose between two approaches.</p><p>Let’s refactor the component that we already wrote to be controlled and uncontrolled at the same time.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f32221f0cb51c232375614859a0b9916/href">https://medium.com/media/f32221f0cb51c232375614859a0b9916/href</a></iframe><p>Let’s review the major aspects of the code.</p><ul><li>If the user passed any value to the value prop the component will convert to be controlled from outside. and that is obviously done by the condition on the localValue variable.</li><li>The uncontrolledValue state holds the inner component’s value and that state will be neglected if the user passed a value to the value prop because the component will take localValue state from value prop.</li></ul><p><strong>Refactor the Component to be Reusable Hook</strong></p><p>We want to build a custom hook to be more reusable and and that hook should receive 3 main inputs which are the value, initialValue, onChange we need all these props for any component either controlled or uncontrolled.</p><p>And the hook should output localValue and onChange, the localValue represents the local state of the component and might be from the value prop (in case controlled) or from the uncontrolledValue (in case uncontrolled).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c84e9e8985d366dacd58cfd2ab780d2/href">https://medium.com/media/6c84e9e8985d366dacd58cfd2ab780d2/href</a></iframe><p>Let’s use that hook in the real world.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1f199a8a64f63563b3f8088de6d137f/href">https://medium.com/media/e1f199a8a64f63563b3f8088de6d137f/href</a></iframe><p>— —</p><p><strong><em>Want to Connect?<br></em></strong><em>Twitter: </em><a href="http://twitter.com/bouhuolia"><em>twitter.com/bouhuolia</em></a><em><br>Github: </em><a href="http://github.com/abouolia"><em>github.com/abouolia</em></a><em><br>Email: a.bouhuolia@gmail.com</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6eda64f2e1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Do React State Management Tools Like Redux, Recoil Actually Work?]]></title>
            <link>https://medium.com/better-programming/how-do-react-state-management-tools-like-redux-recoil-actually-work-5b5913814a6c?source=rss-2d145997d2cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b5913814a6c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ahmed Bouhuolia]]></dc:creator>
            <pubDate>Thu, 19 May 2022 20:54:12 GMT</pubDate>
            <atom:updated>2022-05-19T20:54:12.513Z</atom:updated>
            <content:encoded><![CDATA[<h4>Under the hood</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DqmRsX32NbQjFbmVFnPZSg.jpeg" /></figure><p>There’s been a question in mind for a long time, what differentiates React <strong>Context API</strong> (the React-backed state management) from other state management tools like Redux or Recoil <strong>internally</strong>.</p><p>If you take a look at the documentation of these tools you will see something in common, which is these tools are more adequate for an application that has a global state that mutates frequently.</p><p>Redux and Recoil for example keep telling their users constantly you might don’t need to use our tool if you have a small application with small amount of components, and their state doesn’t mutate frequently, <em>here might be the Context API a good fit</em>.</p><p>As you know Context API is not great in terms of performance, for a simple reason, when any state in Provider is mutated all sub-components under the Provider will re-render.</p><p>Which makes relying on Context API as state management is absolute harsh cause hurts our application performance. if it was a use case like theme colors as a static state that would be a great use case for Context API.</p><p>Every React component re-renders automatically for simple three reasons.</p><ul><li>When the state of the component mutates, even if that state is retrieved from custom hooks like <em>useQuery()</em> or <em>useContext()</em>.</li><li>When the properties of the component are mutated.</li><li>When the parent component re-renders it forces all the children components to re-render, especially if that subcomponent wasn’t wrapped with the memo function.</li></ul><p>Unnecessary re-renders affect the app performance and cause loss of users’ battery which surely no user would want. Let’s see in detail why components get re-rendered and how to prevent unwanted re-rendering to optimize app components.</p><blockquote>Redux and other state management tools like Recoil tried to build an optimized <strong>Observer system</strong> out of React.</blockquote><p>Some tools have different terms and different data structures like Recoil relay on Graph and Set and Redux is more Plain Object oriented with more advanced reducers for complex mutation.</p><h3>Observability System</h3><p>If we look at the Observability system as a big picture, the Observability system is a design pattern, holds state and observers (some called them subscribers) as callbacks and the system notifies these registered observers automatically when the state mutates.</p><p><strong>The Observer design has three main components:</strong> the state or data of the instance, the registered subscribers/observers as stacked callbacks, and a mutator which you can mutate the state, the mutator doesn’t just mutate the state but also tries to notify all registered subscribers/observers when the state is mutated.</p><p>It’s quite different from the publish/subscribe system that allows the design to define specific events that you can send custom arguments or different events that contain values that you need to the subscribers.</p><p><em>We’ll try to implement the Observer System and bind it with React in the next chapter.</em></p><h3>Building Observability System</h3><p>Talking theory is great but let’s talk about implementation. As we mentioned before the Observer has three main components: the state, mutator, and subscriber/observer.</p><p>Obviously, the subscriber is a callback that receives one property reference (the new state), so the Observer interface should have these basic methods that we need to mutate, subscribe and retrieve our state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cbeee5eab0272bf462d860f54a19e56/href">https://medium.com/media/7cbeee5eab0272bf462d860f54a19e56/href</a></iframe><p>The basic flow of the Observer goes like this,</p><ul><li>The getState() method just returns our state.</li><li>The mutate() method mutates our state (e.g. the new user is submitted via the input) and then runs notify() to notify all registered subscribers callbacks with passing along the new state.</li><li>Thesubscriber() where you can register our subscribers or callback to listen when the state mutated.</li></ul><p>I know for sure you’re wondering how to bind that with React to communicate with our React components. We will discuss that in the next chapter and in that chapter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4bc0b867bf1b03a0e68f9a400421e46/href">https://medium.com/media/b4bc0b867bf1b03a0e68f9a400421e46/href</a></iframe><h3>Binding Observability System with React</h3><p>Recoil tried to merge the Observer system and React Binding API in the same library, and other tools like Redux tried to separate the concept <a href="https://github.com/reduxjs/redux#basic-example">Redux</a> as state management and observer in a package and <a href="https://github.com/reduxjs/react-redux">React-redux</a> that bindings Redux to React in a different package.</p><h4>&lt;ObserverProvider&gt;</h4><p>The ObserverProvider that provider will flow the observer class instance to all sub-components. And that provider accepts initialState property to inject an initial state to the Provider that would be passed to Observer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cdfbb8b4a375841c8cd5a27aefef89ec/href">https://medium.com/media/cdfbb8b4a375841c8cd5a27aefef89ec/href</a></iframe><p>The observer instance here injected useRef to avoid any interactive with React reactive system. useRef doesn’t notify the component when its value mutates and that doesn’t cause any re-rendering even if the ref value mutated.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c71bfe040f77e0241341afbe688243ea/href">https://medium.com/media/c71bfe040f77e0241341afbe688243ea/href</a></iframe><h4>useMutate()</h4><p>Basically, the mutate hook useMutate works as a setter function for our state, retrieved the observer instance from the provider, and used the mutate method to send the new mutated state to the observer.</p><p>If you noticed here we wrapped the arrow function with useCallback to avoid re-creating a new function every time when the hooked component re-renders.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09c79e24b93465c3eac11ad260e47ac2/href">https://medium.com/media/09c79e24b93465c3eac11ad260e47ac2/href</a></iframe><h4>useSelector()</h4><p>Obviously the selector hook useSelector works as a getter function for our observer but with some differences.</p><p>Try to sync the observer state with our React local state inside the hook and that gives the ability to communicate and interact with the hooked React components.</p><p>In the first line, we injected the initial state of Observer to React state and then we subscribed to Observer to listen when the state be mutated, and wrapped the subscribe inside useEffect to avoid any revoking when the hooked component re-render, eventually retrieving the React state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb9b6d1ef4d70537dbc9fca111ddd7ee/href">https://medium.com/media/fb9b6d1ef4d70537dbc9fca111ddd7ee/href</a></iframe><p>If you tried to reverse-engineer the most popular React state management tools how they work, you will see their core design centered around that design pattern, some tools have advanced features like reducers to manage mutation complexity in Redux and selector graph dependency in Recoil.</p><p><strong>Resources</strong></p><p><a href="https://refactoring.guru/design-patterns/observer">Observer (refactoring.guru)</a><br><a href="https://codesandbox.io/s/observer-system-binded-react-eyniy0?file=/src/App.tsx"><strong>Complete code of the article</strong></a></p><pre><strong>Want to Connect?</strong></pre><pre>Twitter: <a href="http://twitter.com/bouhuolia">twitter.com/bouhuolia</a><br>Github: <a href="http://github.com/abouolia">github.com/abouolia</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b5913814a6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/how-do-react-state-management-tools-like-redux-recoil-actually-work-5b5913814a6c">How Do React State Management Tools Like Redux, Recoil Actually Work?</a> was originally published in <a href="https://betterprogramming.pub">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>