<?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 Lev Alefirenko on Medium]]></title>
        <description><![CDATA[Stories by Lev Alefirenko on Medium]]></description>
        <link>https://medium.com/@alefirenkolev?source=rss-cee6824f4d5d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nphCVVYNfTEVA9wqU9SnXQ.jpeg</url>
            <title>Stories by Lev Alefirenko on Medium</title>
            <link>https://medium.com/@alefirenkolev?source=rss-cee6824f4d5d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:52:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alefirenkolev/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[Give Your AI Assistant the NgRx Context It’s Missing]]></title>
            <link>https://medium.com/@alefirenkolev/give-your-ai-assistant-the-ngrx-context-its-missing-9a053d4718ad?source=rss-cee6824f4d5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a053d4718ad</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[ai-assisted-coding]]></category>
            <category><![CDATA[openai-codex]]></category>
            <dc:creator><![CDATA[Lev Alefirenko]]></dc:creator>
            <pubDate>Thu, 29 Oct 2026 08:46:06 GMT</pubDate>
            <atom:updated>2026-10-29T08:46:06.611Z</atom:updated>
            <content:encoded><![CDATA[<h4>Debug your NgRx app with your AI coding assistant, using real action history</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URqVw5stUJQIJ-AVuF4vFA.jpeg" /></figure><p>One click triggers the same request three times. I want to find out why.</p><p>When I investigate behavior like this with my AI coding assistant, I want it to see the NgRx actions that actually ran.</p><p>NgRx Inspector is my Chrome DevTools extension for inspecting NgRx actions and state changes in Angular apps. Its new <strong>Copy for AI</strong> button packages a recorded interaction, a short scenario description, and an analysis prompt for my IDE assistant.</p><p>I shared the story behind the extension in <a href="https://medium.com/@alefirenkolev/why-i-built-ngrx-inspector-for-angular-developers-6bbbcfc3d1a9">my first article</a>.</p><h3>When I would use it</h3><p>I built this for situations where an event sequence gives the assistant something concrete to investigate:</p><ul><li><strong>Repeated dispatches:</strong> one interaction produces the same initiating action several times.</li><li><strong>Feedback loops:</strong> a success action starts the process that produced it.</li><li><strong>Stale results:</strong> an asynchronous response updates state after the user cancels or changes an operation.</li><li><strong>Overlapping handlers:</strong> several effects may respond to one action and produce duplicate work.</li><li><strong>Broken failure flows:</strong> a loading state gets stuck, or a retry produces no expected follow-up.</li><li><strong>Refactoring:</strong> I want to discuss effect responsibilities and compare a recorded workflow before and after a change.</li></ul><p>These are investigation prompts. Repeated actions can also be perfectly valid: polling, retries, or separate user interactions. The source code and the intended behavior still matter.</p><h3>From the browser to the assistant</h3><p>I clear the Inspector history, reproduce the issue with the panel visible, and click <strong>Copy for AI</strong>. I describe the scenario, review the preview, and click <strong>Copy</strong>.</p><p>You don’t need to write the next great American novel: “Opened the catalog once; products keep reloading” is a perfectly useful scenario description.</p><p>Back in the application’s IDE workspace, I paste the <strong>copied text into my AI assistant’s chat</strong> and send it. The built-in prompt is already included.</p><p>The export is prepared locally and contains the prompt plus JSON with actions, payloads, and changed state paths. Missing history and incomplete data are marked.</p><p>The built-in prompt asks the assistant to find dispatch sites, effects, and reducers; cite events and source lines; separate confirmed problems from hypotheses; and suggest verification steps. It requests analysis before any edits.</p><p>The examples below were created specifically for this demo, using deliberately introduced bugs. I also use Copy for AI in everyday work on business applications, and I invite you to try it in yours.</p><h3>The catalog keeps reloading its data</h3><p>Both scenarios use the Form Supply shop from the first article, with real NgRx Store and Effects and simulated API responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*juX_JHlsQOEZcSuY1KfSNQ.png" /><figcaption>The same Angular shop, with controls for reproducing two deliberate defects and comparing their corrected behavior.</figcaption></figure><p>I open the catalog once. The products load, but another load starts without another click.</p><p>After preparing the shop and clearing Inspector history, the relevant sequence is:</p><pre>/* CAPTURED ACTION ORDER */<br>1  [Catalog Page] Opened<br>2  [Products API] Load products success<br>3  [Catalog Page] Opened<br>4  [Products API] Load products success<br>5  [Catalog Page] Opened<br>6  [Products API] Load products success<br>7  [Article Harness] Capture stopped</pre><p>The final event is the demo harness stopping the loop after three loads.</p><p>I describe the unexpected repetition in Copy for AI and send the export to my IDE assistant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-bs6e6OLtKvUL0IAM5J8w.png" /><figcaption>The actual Copy for AI dialog: seven captured events, the reproduction description, payload control, and the prompt with JSON.</figcaption></figure><p>Here is the assistant’s finding, condensed and checked against the source:</p><blockquote><strong><em>Confirmed feedback loop.</em></strong><em> Opening the catalog once produced three completed loads. The extra loads were started by an effect, without another user interaction.</em></blockquote><blockquote><em>reloadAfterLoad responds to a successful load by dispatching </em><em>CatalogActions.opened again. That triggers </em><em>loadProducts, whose success feeds the same cycle (</em><em>shop.effects.ts:31–56).</em></blockquote><blockquote><strong><em>Verification:</em></strong><em> remove </em><em>reloadAfterLoad and repeat the same interaction. Expect one completed load.</em></blockquote><p>Simplified, the faulty effect does this:</p><pre>/* FAULTY FEEDBACK EDGE */<br>actions.pipe(<br>  ofType(ProductsApiActions.loadProductsSuccess),<br>  switchMap(() =&gt; timer(120).pipe(<br>    map(() =&gt; CatalogActions.opened())<br>  ))<br>)</pre><p>The fix is to remove reloadAfterLoad and keep loads tied to opening the page or explicitly refreshing it. The corrected demo disables that effect.</p><p><strong>Before:</strong> opening the catalog once caused three loads. <strong>After:</strong> the same interaction caused one. A Store/Effects integration test checks that result.</p><h3>A promo code that returns after removal</h3><p>The demo submits FORM10, then removes it before the response arrives. I expect the coupon to stay removed, but a late success restores it:</p><pre>/* CAPTURED ACTION ORDER */<br>1  [Cart] Promo code submitted<br>2  [Cart] Promo code removed<br>3  [Promo API] Apply code success</pre><p>The Copy for AI export shows that the final event changes cart.coupon, the discount, the total, and the promo status. Those paths tell the assistant where to look without exporting the entire Store.</p><blockquote><strong><em>Confirmed stale result.</em></strong><em> Removing the promo code leaves the pending subscription active in </em><em>applyPromo (</em><em>shop.effects.ts:88–100). When the result arrives, </em><em>cartReducer accepts it and restores the coupon and discount (</em><em>shop.reducers.ts:165–174).</em></blockquote><p>The fix restores cancellation on promoCodeRemoved:</p><pre>/* CANCELLATION IN THE CORRECTED FLOW */<br>takeUntil(actions.pipe(ofType(<br>  DemoActions.reset,<br>  CartActions.promoCodeRemoved,<br>  OrdersApiActions.placeOrderSuccess<br>)))</pre><p>The corrected run contains only submitted and removed. After waiting beyond the simulated API’s response window, the coupon stays empty and the discount stays zero. The integration test checks the same result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lAERDOFEO6jdhjph1fTvwg.png" /><figcaption>Same product and submit/remove intents. The late result restores a $14.90 discount in broken mode; the corrected flow keeps the coupon removed.</figcaption></figure><h3>What to keep in mind</h3><p>V1 exports all retained events, including those hidden by filters, with a history limit of 200 records. Opening the dialog freezes the capture; reopen it to include newer events. Capture pauses while the Inspector panel is hidden.</p><p>The export contains compact summaries of state changes rather than full Store values. Payloads are not automatically redacted, so I review them before sharing or turn off <strong>Include action payloads</strong>.</p><p>Event order alone does not establish causality, and timestamps are not request-duration measurements. The export has no network trace. In these examples, the cause is confirmed by the effects.</p><p>Copy for AI gives my IDE assistant a concrete interaction to investigate. I review its findings, request the change I want, and record the same scenario again.</p><p>Try <a href="https://chromewebstore.google.com/detail/ngrx-inspector/bmhafdgiifbmjgdpmbicgcfjglmcmlma">NgRx Inspector</a> on a workflow you want to investigate. <a href="https://www.npmjs.com/package/ngrx-inspector">Connect your Angular app</a>, capture what happens, and bring it to your IDE assistant. I’d like to hear what you uncover.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a053d4718ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Built My Own NgRx Debugging Tool]]></title>
            <link>https://medium.com/@alefirenkolev/why-i-built-ngrx-inspector-for-angular-developers-6bbbcfc3d1a9?source=rss-cee6824f4d5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bbbcfc3d1a9</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[ngrx]]></category>
            <dc:creator><![CDATA[Lev Alefirenko]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 12:40:34 GMT</pubDate>
            <atom:updated>2026-10-21T13:02:55.645Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d2qyv1rJZU_rO_9ytl7m_Q.jpeg" /></figure><p>As an Angular developer, I often need to trace how a user interaction changes application state. In projects that use NgRx for state management, I usually start with three questions: which action was dispatched, what data it carried, and how the state changed afterward.</p><p>I might be investigating a value that did not update or trying to find where a checkout flow went wrong. Either way, I need to follow the sequence of actions and inspect the data at each step.</p><p>For a long time, I used one of the popular browser extensions for inspecting application state. It offered many features, including time-travel debugging, which lets you restore a previous Store state. In everyday work, I used only a small part of what it offered.</p><p>The action list also filled up with internal NgRx actions and recurring infrastructure events from my application. I could filter them out, but I wanted a workflow built around the actions I was investigating.</p><p>So I decided to build a small tool around the way I debug: an action list, payload and state inspection, a detailed diff, and saved filters for hiding actions by prefix.</p><p>That became <strong>NgRx Inspector</strong>, a Chrome DevTools extension for Angular applications that use NgRx. It focuses on observing actions and state changes; time-travel debugging is outside its scope.</p><p>The panel lives alongside the other DevTools tabs. Once the application is connected, open Chrome DevTools and select <strong>NgRx Inspector</strong>. If the tab is hidden, look in the tab overflow menu.</p><p>Let’s see how the extension works alongside an application, using an online store as an example.</p><p>The demo has a product catalog, a cart, a promo code, and checkout. Interactions in the UI dispatch real NgRx actions, so we can follow a change from the storefront to the Store.</p><p>In this example, [Cart] Workspace bundle applied updates several parts of the cart at once. The headphones move to the first position, their quantity increases from two to three, and their gift wrap option changes. A speaker is added, a lamp is removed, and the discount and total are recalculated. Selecting <strong>Diff</strong> shows what this one action changed, alongside the result in the store&#39;s UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BnMBvfwfpC-fwdKpAZyZJA.png" /><figcaption><em>One action changes the cart’s items, their order, nested options, and totals. Monetary values in the Store are in cents; the UI total also includes shipping.</em></figcaption></figure><p>Nested objects and arrays were an important part of building the diff view. The inspector shows which fields changed and which items were added or removed. For array items with stable id fields, it also identifies moves, making it easier to distinguish a reordered item from a replacement.</p><p>Each selected action has three tabs: <strong>Payload</strong> shows the action and its data, <strong>State</strong> shows the Store after the action was processed, and <strong>Diff</strong> shows what changed since the previous captured state.</p><p>Next, I check out with the same cart and select [Orders API] Place order success. Its payload contains the confirmed order: products, shipping address, discount, totals, and payment status. From there, I can switch to <strong>State</strong> to inspect the saved order and the now-empty cart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJZG9DrXP1wh8RXGCcaEJA.png" /><figcaption><em>The confirmed order in Payload, with products, shipping details, totals, and payment status.</em></figcaption></figure><p>Filtering matters just as much when following a longer sequence.</p><p>Internal actions with the @ngrx prefix, viewport updates, and other infrastructure events can be useful for some tasks. When I am debugging checkout logic, they usually add more to scan through.</p><p>In settings, I can save prefixes and enable or disable each rule as needed. Here, I hide [Demo] and [Catalog Page] actions while keeping [Cart] actions visible. That leaves more room for the sequence I care about.</p><p>These filters control the action list in the inspector. The application continues to process every action as usual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KqCXjSuzH92ZagPoVRwxlQ.png" /><figcaption><em>Checked rules hide matching prefixes. Cart actions remain visible while demo and catalog events are hidden.</em></figcaption></figure><p>When I investigate checkout, I want to follow the sequence from cart changes to the API response and find where the data diverged from what I expected. That is the workflow I built NgRx Inspector to support.</p><p>To try it, install the extension from the <a href="https://chromewebstore.google.com/detail/ngrx-inspector/bmhafdgiifbmjgdpmbicgcfjglmcmlma?utm_source=medium&amp;amp;utm_medium=referral&amp;amp;utm_campaign=ngrx_inspector_launch">Chrome Web Store</a>. In your Angular application, install the <a href="https://www.npmjs.com/package/ngrx-inspector">ngrx-inspector</a> package and add provideNgRxInspector() to the application providers alongside your existing NgRx Store configuration. The integration runs in development mode.</p><p>If you try it on one of your own workflows, I would love to hear what helped and what was missing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bbbcfc3d1a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>