<?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[@ngrx - Medium]]></title>
        <description><![CDATA[We build reactive libraries for Angular - Medium]]></description>
        <link>https://medium.com/ngrx?source=rss----5d62081307f7---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>@ngrx - Medium</title>
            <link>https://medium.com/ngrx?source=rss----5d62081307f7---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 00:33:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ngrx" 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 NgRx Version 13: Ivy Builds, Feature Creators, Improved Selectors, and more!]]></title>
            <link>https://medium.com/ngrx/announcing-ngrx-version-13-ivy-builds-feature-creators-improved-selectors-and-more-6a1a4c52c824?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/6a1a4c52c824</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[ivy]]></category>
            <dc:creator><![CDATA[Brandon Roberts]]></dc:creator>
            <pubDate>Wed, 17 Nov 2021 15:03:29 GMT</pubDate>
            <atom:updated>2021-11-17T15:17:57.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vweUSL7IrbiVchJS.png" /></figure><p>Today we’re happy to announce the version 13 release of the NgRx platform. This release contains new features, bug fixes, and some breaking changes, all aimed at improving the developer experience when using NgRx libraries.</p><h3>Ivy Compiled Libraries 🍃</h3><p>NgRx libraries are now compiled with Ivy! This isn’t so much a feature of NgRx itself but a milestone in the development lifecycle of Angular. It does benefit NgRx libraries in that they no longer have to be processed by the Angular Compabitility Compiler(ngcc) for libraries previously built with ViewEngine. This also allowed us to remove Ivy-specific checks from our codebase and documentation, such as having to wrap reducers in exported functions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47e94b99b35db7f22257c89c8b06be04/href">https://medium.com/media/47e94b99b35db7f22257c89c8b06be04/href</a></iframe><p>Now we are able to move forward with directly using the reducer created with createReducer. Libraries partially compiled with Ivy pave the way for us to move to the next generation of Ivy features. We recommend <em>all</em> authors of Angular libraries update your packages to be <a href="https://blog.angular.io/upcoming-improvements-to-angular-library-distribution-76c02f782aa4">built with Angular v13</a> to keep moving the Angular ecosystem forward.</p><h3>Feature Creators 🪄</h3><p>Improving the developer experience of state management with NgRx is one of the things we’re always looking to improve. We introduced creator functions to minimize the amount of code you have to write and maintain when using NgRx Store. We’ve continued to slim down the APIs needed for creating the code needed for a feature by introducing the createFeature function. This function combines the feature key, reducer, and selectors for a given slice of state into a single object. Core team member <a href="https://twitter.com/markostdev">Marko Stanimirović</a> wrote a blog post detailing the <a href="https://dev.to/this-is-angular/ngrx-feature-creator-2c72">NgRx Feature Creator</a>, with snippets included below.</p><p>Let’s look at a previous example of setting up a feature slice.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7950698ddf37a3522b7458aaac5cb09c/href">https://medium.com/media/7950698ddf37a3522b7458aaac5cb09c/href</a></iframe><p>With the createFeature function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd76b1f3ab5b2338b3b271ce87339a29/href">https://medium.com/media/cd76b1f3ab5b2338b3b271ce87339a29/href</a></iframe><p>Selectors are also generated from the feature, making it more straightforward to create view models.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b8cba7413e161038761d4de2c4e8fde/href">https://medium.com/media/2b8cba7413e161038761d4de2c4e8fde/href</a></iframe><p>You can also read about creating features in our <a href="https://ngrx.io/guide/store/feature-creators">feature creators</a> guide.</p><h3>Improved Selectors 🤩</h3><p>Selectors are one of the ways to get the most out of state management with NgRx. In previous versions of NgRx, you were limited to a maximum of 8 selectors that could be <a href="https://dev.to/brandontroberts/maximizing-and-simplifying-component-views-with-ngrx-selectors-286j">combined and composed</a> with createSelector and guaranteed type safety. With advancements in TypeScript and the introduction of <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#variadic-tuple-types">variadic tuple types</a>, we have now been able to lift that restriction and provide type safety for any number of combined selectors. The signature for creating selectors is still the same.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b6182a15155a100f7111d5d0d560544/href">https://medium.com/media/3b6182a15155a100f7111d5d0d560544/href</a></iframe><p>While we still recommend 8 combined selectors as a soft limit, the improvements to the selector types allow for additional use cases without manual types being added.</p><p>Thanks to <a href="https://twitter.com/pkdavidstorm">David Shortman</a> for working with us to implement these features!</p><h3>Swag store and Discord Server! 🦺</h3><p>You can get official NgRx swag through our store! T-shirts with the NgRx logo are available in many different sizes, materials, and colors. We will look at adding new items to the store such as stickers, magnets, and more in the future. <a href="https://ngrx.threadless.com/">Visit our store</a> to get your NgRx swag today!</p><p>Join our <a href="https://discord.gg/ngrx">discord server</a> for those who want to engage with other members of the NgRx community, old and new. You can sign up for an account here. We also still have a large community of users on the <a href="https://gitter.im/ngrx/platform">gitter channel</a> as well that provides continued help and support to our users.</p><h3>Deprecations and Breaking Changes</h3><p>This release contains bug fixes, deprecations, and breaking changes. For most of these deprecations or breaking changes, we’ve provided a migration that automatically runs when you upgrade your application to the latest version.</p><p>Take a look at the <a href="https://ngrx.io/guide/migration/v13">version 13 migration guide</a> for complete information regarding migrating to the latest release. The complete <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">CHANGELOG</a> can be found in our <a href="https://github.com/ngrx/platform">GitHub repository</a>.</p><h3>Upgrading to NgRx 13</h3><p>To start using NgRx 13, make sure to have the following minimum versions installed:</p><ul><li>Angular version 13.x</li><li>Angular CLI version 13.x</li><li>TypeScript version 4.4.x</li><li>RxJS version 6.5.x or RxJS version 7.4.x</li></ul><p>NgRx supports using the Angular CLI ng update command to update your NgRx packages. To update your packages to the latest version, run the command:</p><pre>ng update @ngrx/store</pre><h3>Contributing to NgRx</h3><p>We’re always trying to improve the docs and keep them up-to-date for users of the NgRx framework. To help us, you can start contributing to NgRx. If you’re unsure where to start, come take a look at our <a href="https://ngrx.io/contributing">contribution guide</a> and watch the <a href="https://www.youtube.com/watch?v=ug0c1tUegm4">introduction video</a> <a href="https://twitter.com/niklas_wortmann">Jan-Niklas Wortmann</a> and <a href="https://twitter.com/brandontroberts">Brandon Roberts</a> have made to help you get started.</p><h3>Thanks to all our contributors and sponsors</h3><p>NgRx continues to be a community-driven project. Design, development, documentation, and testing all are done with the help of the community. We’ve recently added a <a href="https://ngrx.io/about?group=Community">community section to the NgRx team page</a> that lists every person that has contributed to the platform.</p><p>If you are interested in contributing, visit our <a href="https://github.com/ngrx/platform">GitHub</a> page and look through our open issues, some marked specifically for new contributors. We also have active GitHub discussions for new features and enhancements.</p><figure><a href="https://nrwl.io/"><img alt="" src="https://cdn-images-1.medium.com/max/806/0*TVXFTqaSiuNR4px2" /></a></figure><p>We want to give a big thanks to our Gold sponsor, <a href="https://nrwl.io/">N</a>arhwal Technologies! Nrwl has been a longtime promoter of NgRx as a tool when building large applications in Angular, and is committed to supporting open source projects that they rely on for Nx.</p><p><a href="https://nx.dev/">Nx</a> helps architect, test, and build at any scale: It has integrations with modern frameworks, distributed task execution, computation caching, smart rebuilds of affected projects, powerful code generators, editor support, GitHub apps, and more.</p><p>With Nrwl, you’ll find a consulting firm that truly enables you to get a deeper understanding and navigate the most nuanced challenges of building software with Angular, React, and other modern Javascript frameworks.</p><p>Comprised of former Angular team members, Googlers, and renowned experts, when working with us, you’ll build software better and faster. You can leverage their consulting, training, and engineering, plus open-source tools like <a href="https://nx.dev/">Nx</a> to elevate your enterprise’s development practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*FRn8XhME-LzHH8lVA802cQ.png" /></figure><p>We would also like to give a big thanks to our silver sponsor, <a href="https://www.briebug.com/">BrieBug</a>. BrieBug is one of the top web and mobile application development consulting firms in the state of Colorado. BrieBug provides enterprise Angular consulting, architectural reviews, team training, and staff augmentation, with multiple Angular GDEs on staff. BrieBug is also a longtime sponsor of the NgRx project, providing further support for development, and hosting expenses.</p><h3>Sponsor NgRx</h3><p>NgRx requires significant time and effort that often goes unpaid, and we would like to change that. If you or your company wants to sponsor the continued development of NgRx, please visit our <a href="https://opencollective.com/ngrx">OpenCollective</a> page for different contribution options, buy some swag from our <a href="https://ngrx.threadless.com/">swag store</a>, or <a href="https://ngrx.io/about">contact us</a> directly for other sponsorship opportunities.</p><p>Follow us on <a href="https://medium.com/ngrx">Medium</a> and on <a href="https://twitter.com/ngrx_io">Twitter</a> for the latest updates about the NgRx platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a1a4c52c824" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/announcing-ngrx-version-13-ivy-builds-feature-creators-improved-selectors-and-more-6a1a4c52c824">Announcing NgRx Version 13: Ivy Builds, Feature Creators, Improved Selectors, and more!</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing NgRx Version 12: New operator for Effects, ComponentStore Enhancements, Integrated…]]></title>
            <link>https://medium.com/ngrx/announcing-ngrx-version-12-new-operator-for-effects-componentstore-enhancements-integrated-9dcb2519d495?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/9dcb2519d495</guid>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Brandon Roberts]]></dc:creator>
            <pubDate>Thu, 13 May 2021 13:06:19 GMT</pubDate>
            <atom:updated>2021-06-14T12:50:25.544Z</atom:updated>
            <content:encoded><![CDATA[<h3>Announcing NgRx Version 12: New operator for Effects, ComponentStore Enhancements, Integrated support for ESLint, and more!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vweUSL7IrbiVchJS.png" /></figure><p>Today we’re happy to announce the version 12 release of the NgRx platform. This release contains new features, bug fixes, and some breaking changes, all aimed at improving the developer experience when using NgRx libraries.</p><h3>New concatLatestFrom operator for NgRx Effects</h3><p>NgRx Effects allows you to isolate side effect logic from your components by listening to observable streams to perform some task. Effects are usually initiated by an action being dispatched that contains some additional metadata. There are also scenarios where Effects need to read data from the Store to provide additional context. This lead to surprising behavior when combined with using selectors, as the selectors were subscribed to eagerly instead of waiting until the action is dispatched. As this behavior is part of RxJS itself, we introduced a new <strong>concatLatestFrom</strong> operator to mitigate this behavior and allow safe usage of data from the store in Effects.</p><p>The <strong>concatLatestFrom</strong> operator functions similarly to <a href="https://rxjs.dev/api/operators/withLatestFrom">withLatestFrom</a> with one important difference being that it lazily evaluates the provided Observable factory. This prevents the provided observables from emitting before the action is dispatched.</p><p>This allows you to use the source value when selecting additional sources to concat.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/03fb33c5b83330910158bc7e892d3e0c/href">https://medium.com/media/03fb33c5b83330910158bc7e892d3e0c/href</a></iframe><p>Learn more about the <strong>concatLatestFrom</strong> operator in the <a href="https://ngrx.io/guide/effects/operators">operators guide</a>.</p><h3>ComponentStore Enhancements</h3><p>NgRx ComponentStore is quickly becoming the library Angular developers use more often to manage state within their applications, regardless of size. ComponentStore provides local state management that is <strong>completely independent</strong> of our global state management library, NgRx Store. We’ve continued to updated ComponentStore with small, but effective improvements to give developers more tools to manage state efficiently and reactively. Below are a new few updates:</p><ul><li>Added a <strong>patchState</strong> method for partial updates that can accept data synchronously or with an observable.</li><li>Added a <strong>tapResponse</strong> operator for handling data/error emissions.</li><li>Added <strong>schematics</strong> for scaffolding a ComponentStore service and optionally adding it component providers.</li></ul><p>Watch our <a href="https://youtu.be/8ZZmkJnfb54?t=3540">keynote from ng-conf 2021</a> to get an overview of ComponentStore</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8ZZmkJnfb54%3Fstart%3D3540%26feature%3Doembed%26start%3D3540&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8ZZmkJnfb54&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8ZZmkJnfb54%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5eed7a39eec9fd2eb60db86540c17390/href">https://medium.com/media/5eed7a39eec9fd2eb60db86540c17390/href</a></iframe><p>If you haven’t looked at NgRx libraries in a while, check out <a href="https://ngrx.io/guide/component-store">ComponentStore</a> to see how it can fit into your application.</p><h3>Integrated Support for ESLint</h3><p>Whenever developers start using a new library, having rules and constraints in place aid developers in avoiding common pitfalls. ESLint rules for NgRx recommended practices have been in place for a long time but were still something you have to add yourself after adding NgRx Store to your application. We’ve made this process simpler by integrating the ESLint rules from the eslint-plugin-ngrx library into the installation of NgRx store. The following command to add NgRx Store to your project is still the same.</p><p>ng add @ngrx/store</p><p>When running this command, NgRx Store is added, along with setting up the ESLint rules for NgRx, giving you recommended practices, automated checks, and automated fixes right out of the box. The ESLint rules are maintained by fellow team member Tim Deschryver, and other community contributors. We think this will help developers get off to a better start when using NgRx libraries. Check out the <a href="https://github.com/timdeschryver/eslint-plugin-ngrx">eslint-plugin-ngrx</a> repository for more details, including adding the ESLint plugin to your existing projects.</p><h3>Swag store and Discord Server!</h3><p>You can get official NgRx swag through our store! T-shirts with the NgRx logo are available in many different sizes, materials, and colors. We will look at adding new items to the store such as stickers, magnets, and more in the future. <a href="https://ngrx.threadless.com/">Visit our store</a> to get your NgRx swag today!</p><p>Join our <a href="https://discord.gg/ngrx">discord server</a> for those who want to engage with other members of the NgRx community, old and new. You can sign up for an account here. We also still have a large community of users on the <a href="https://gitter.im/ngrx/platform">gitter channel</a> as well that provides continued help and support to our users.</p><h3>Breaking Changes</h3><p>This release contains bug fixes, along with breaking changes. For most of these breaking changes, we’ve provided a migration that automatically runs when you upgrade your application to the latest version.</p><p>Take a look at the <a href="https://ngrx.io/guide/migration/v12">version 12 migration guide</a> for complete information regarding migrating to the latest release. The complete <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">CHANGELOG</a> can be found in our <a href="https://github.com/ngrx/platform">GitHub repository</a>.</p><h3>Upgrading to NgRx 12</h3><p>To start using NgRx 12, make sure to have the following minimum versions installed:</p><ul><li>Angular version 12.x</li><li>Angular CLI version 12.x</li><li>TypeScript version 4.2.x</li><li>RxJS version 6.5.x</li></ul><p>NgRx supports using the Angular CLI ng update command to update your NgRx packages. To update your packages to the latest version, run the command:</p><pre>ng update @ngrx/store</pre><h3>Contributing to NgRx</h3><p>We’re always trying to improve the docs and keep them up-to-date for users of the NgRx framework. To help us, you can start contributing to NgRx. If you’re unsure where to start, come take a look at our <a href="https://next.ngrx.io/contributing">contribution guide</a> and watch the <a href="https://www.youtube.com/watch?v=ug0c1tUegm4">introduction video</a> <a href="https://twitter.com/niklas_wortmann">Jan-Niklas Wortmann</a> and <a href="https://twitter.com/brandontroberts">Brandon Roberts</a> have made to help you get started.</p><h3>Thanks to all our contributors and sponsors</h3><p>NgRx continues to be a community-driven project. Design, development, documentation, and testing all are done with the help of the community. We would like to thank the contributors that helped to work towards this release of NgRx: Adam L Barrett, Adam Nagy, Alan Agius, Alexandr Vanilchuk, AlmaniaM, Bitcollage, Booster2ooo, Bruno Baia, Cheong Yip, Damion C, Daniel Schuba, David, Dayne May, Dzhavat Ushev, Enea Jahollari, Felix Lemke, Fyodor, George Suveti, Guilherme Siquinelli, Hadrien TOMA, Jay Bell, Jeffrey Bosch, Jeremias Peier, Jonas Auer, Jordan, Krishna Mohan, Kuba Sekowski, Lars Gyrup Brink Nielsen, MG, Maksym Kochanov, Marko Stanimirović, Martin V, Mateusz Stefańczyk, Matthew Harris, Michael Monerau, Mike Dalrymple, Moisés, Morten Bjerg Gregersen, Nils Mehlhorn, Omar Hasan, Oscar Flores, Pedro, Pierre-Edouard Galtier, Rafael Santana, Rovshen Nazarov, Sameera Perera, Samet Alemdar, Samuel Fernández, Sebastian Podgajny, Shaun Jackson, Stephen Cavaliere, Suguru Inatomi, Tiago Temporin, Tiffany Chen, Tim Deschryver, Travis Vroman, Tushar Chauhan, Wataru KASAHARA, Yuto Hara, Zac Svoboda, Zachary DeRose, arpan patel, ddbk, moniuch.</p><p>If you are interested in contributing, visit our <a href="https://github.com/ngrx/platform">GitHub</a> page and look through our open issues, some marked specifically for new contributors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/0*TVXFTqaSiuNR4px2" /></figure><p>We want to give a big thanks to our Gold sponsor, <a href="https://nrwl.io/">N</a>arhwal Technologies! Nrwl has been a longtime promoter of NgRx as a tool when building large applications in Angular, and is committed to supporting open source projects that they rely on for Nx.</p><p>With Nrwl, you’ll find a consulting firm that truly enables you to get a deeper understanding and navigate the most nuanced challenges of building software with Angular, React, and other modern Javascript frameworks.</p><p>Comprised of former Angular team members, Googlers, and renowned experts, when working with us, you’ll build software better and faster. You can leverage their consulting, training, and engineering, plus open-source tools like <a href="https://nx.dev/">Nx</a> to elevate your enterprise’s development practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*FRn8XhME-LzHH8lVA802cQ.png" /></figure><p>We would also like to give a big thanks to our silver sponsor, <a href="https://www.briebug.com/">BrieBug</a>. BrieBug is one of the top web and mobile application development consulting firms in the state of Colorado. BrieBug provides enterprise Angular consulting, architectural reviews, team training, and staff augmentation, with multiple Angular GDEs on staff. BrieBug is also a longtime sponsor of the NgRx project, providing further support for development, and hosting expenses.</p><h3>Sponsor NgRx</h3><p>NgRx requires significant time and effort that often goes unpaid, and we would like to change that. If you or your company wants to sponsor the continued development of NgRx, please visit our <a href="https://opencollective.com/ngrx">OpenCollective</a> page for different contribution options, buy some swag from our <a href="https://ngrx.threadless.com/">swag store</a>, or <a href="https://ngrx.io/about">contact us</a> directly for other sponsorship opportunities.</p><p>Follow us on <a href="https://medium.com/ngrx">Medium</a> and on <a href="https://twitter.com/ngrx_io">Twitter</a> for the latest updates about the NgRx platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dcb2519d495" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/announcing-ngrx-version-12-new-operator-for-effects-componentstore-enhancements-integrated-9dcb2519d495">Announcing NgRx Version 12: New operator for Effects, ComponentStore Enhancements, Integrated…</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing NgRx Version 10: New packages for local component state and reactive components, swag…]]></title>
            <link>https://medium.com/ngrx/announcing-ngrx-version-10-new-packages-for-local-component-state-and-reactive-components-swag-62bedda0be91?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/62bedda0be91</guid>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Brandon Roberts]]></dc:creator>
            <pubDate>Mon, 10 Aug 2020 15:43:42 GMT</pubDate>
            <atom:updated>2020-08-11T12:01:10.648Z</atom:updated>
            <content:encoded><![CDATA[<h3>Announcing NgRx Version 10: New packages for local component state and reactive components, swag store, and more!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vweUSL7IrbiVchJS.png" /></figure><p>Today we’re happy to announce the version 10 release of the NgRx platform. This release contains new features, bug fixes, and some breaking changes, all aimed at improving the developer experience when using NgRx libraries.</p><h3>NgRx Conf Update⏲️</h3><p>In the <a href="https://medium.com/ngrx/announcing-ngrx-version-9-immutability-out-of-the-box-customizable-effects-and-more-e4cf71be1a5b">version 9 release announcement</a>, we also announced NgRx Conf, a celebration of all things Reactive Angular. As with many other conferences this year, we had to make some adjustments, and will not have an in-person conference this year. We are continuing to work with our vendors and partners to move the conference to a tentative date of May 20th-21st, 2021. We will provide more details about planned activities for 2020.</p><p>Follow <a href="https://twitter.com/NgRxConf">@NgRxConf</a> for future updates!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TDnzk2C7MF-VPU-U.png" /></figure><h3>NgRx Conf’s Premier Sponsor</h3><p>We also welcome <a href="https://nrwl.io/">Nrwl</a> as our premier sponsor for NgRx Conf! Nrwl has been a longtime promoter of NgRx as a tool when building large applications in Angular, and we couldn’t be more excited to have them partner with us for NgRx Conf.</p><p>With Nrwl, you’ll find a consulting firm that truly enables you to get a deeper understanding and navigate the most nuanced challenges of building software with Angular, React, and other modern Javascript frameworks.</p><p>Comprised of former Angular team members, Googlers, and renowned experts, when working with us, you’ll build software better and faster. You can leverage our consulting, training, and engineering, plus open-source tools like <a href="https://nx.dev/">Nx</a> to elevate your enterprise’s development practice.</p><h3>New ComponentStore package for local state management</h3><p>NgRx Store is about managing complex state from many different sources at a global application level. In some cases, you still want to manage state in a consistent way locally, and don’t need the indirection of actions, reducers, and effects. We’ve designed a new package to handle state at a local level while providing the same benefits similar to the NgRx Store. Check out the <a href="https://ngrx.io/guide/component-store/comparison">comparison</a> between them in our documentation.</p><p><strong>ComponentStore</strong> is a stand-alone library that helps to manage local/component state. It’s an alternative to reactive push-based “Service with a Subject” approach.</p><p><strong>Key Concepts</strong></p><ul><li>Local state is typically tied to the life-cycle of a particular component, and is cleaned up when that component is destroyed</li><li>Local state can be updated through a setState method. An update can also be defined using an updater method imperatively or with an observable. No indirection from actions is required.</li><li>Local state can be read through observable state$ property, and by a defined selector using the select method. The select method can also be used for the composition of data from multiple sources, such as other selectors, global store or any other observables.</li><li>Side effects can be triggered through an effect method, imperatively or with an observable.</li></ul><p>To install the package, use the ng add command:</p><pre>ng add @ngrx/component-store</pre><p>To define a local store, extend the ComponentStore class with the shape of your local state:</p><pre>export interface MoviesState {<br>  movies: Movie[];<br>}</pre><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class MoviesStore extends ComponentStore&lt;MoviesState&gt; {<br>  <br>  constructor() {<br>    super({movies: []});<br>  }<br>}</pre><p>To read data, use the select method:</p><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class MoviesStore extends ComponentStore&lt;MoviesState&gt; {<br>  <br>  constructor() {<br>    super({movies:[]});<br>  }<br> <br>  readonly movies$: Observable&lt;Movie[]&gt; = this.select(<br>    state =&gt; state.movies);<br>}</pre><p>To update the store, define an updater:</p><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class MoviesStore extends ComponentStore&lt;MoviesState&gt; {<br>  <br>  constructor() {<br>    super({movies: []});<br>  }</pre><pre>  readonly movies$: Observable&lt;Movie[]&gt; = this.select(<br>    state =&gt; state.movies);</pre><pre>  readonly addMovies = this.updater((state, movie: Movie[]) =&gt; ({<br>    movies: [...state.movies, ...movies],<br>  }));<br>}</pre><p>To define a side-effect, use the effect method.</p><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class MoviesStore extends ComponentStore&lt;MoviesState&gt; {<br>  <br>  constructor(private readonly moviesService: MoviesService) {<br>    super({movies: []});<br>  }</pre><pre>  readonly movies$: Observable&lt;Movie[]&gt; = this.select(<br>    state =&gt; state.movies);</pre><pre>  readonly addMovies = this.updater((state, movie: Movie[]) =&gt; ({<br>    movies: [...state.movies, ...movies],<br>  }));</pre><pre>  readonly getMovies = this.effect(() =&gt; {<br>    return this.moviesService.fetchMovies().pipe(<br>        tap({<br>          next: (movie) =&gt; this.addMovies(movies),<br>          error: (e) =&gt; this.logError(e),<br>        }),<br>        catchError(() =&gt; EMPTY),<br>      ))<br>    );<br>  })<br>}</pre><p>To use the local store, add it to your <strong>component</strong> providers, and use the store to manage state:</p><pre><a href="http://twitter.com/Component">@Component</a>({<br>  template: `<br>    &lt;div *ngFor=&quot;let movie of movies$ | async&quot;&gt;<br>      {{ movie.name }}<br>    &lt;/div&gt;<br>  `,<br>   providers: [MoviesStore],<br>})<br>export class MoviesPageComponent implements OnInit {<br>  movies$ = this.moviesStore.movies$;</pre><pre>  constructor(private readonly moviesStore: MoviesStore) {}<br> <br>  ngOnInit() {<br>    this.moviesStore.getMovies();<br>  }<br>}</pre><p><a href="https://ngrx.io/guide/component-store"><strong>Read more</strong></a> about using ComponentStore in our documentation.</p><p><strong>NgRx ComponentStore</strong> gives you the ability to manage local state and side effects without manual subscriptions, and easy integration with <strong><em>any</em></strong> global state management solution. Thanks to <strong>Kevin Elko</strong> for the original implementation, and to all the community for contributing feedback for this new package!</p><h3>New Component package for more reactive components (Experimental)</h3><p>As we move forward in this new world with Ivy, we want to rethink how we handle reactivity in Angular Zoneless applications. The <strong>async</strong> pipe set a standard for Angular applications for handling observables and promises in the template. NgRx Component goes further to help you build fully reactive applications with helpers for rendering using observables in the template.</p><p><strong>Key Concepts</strong></p><ul><li>Providing a better way to handle observables in the template</li><li>Providing smarter handling of change detection for performance-sensitive UIs.</li></ul><p>To install the package, use the ng add command:</p><pre>ng add @ngrx/component</pre><p>To use the pipe or directive, add the ReactiveComponentModule to your NgModule’s imports:</p><pre>import { ReactiveComponentModule } from &#39;@ngrx/component&#39;;</pre><pre><br>@NgModule({<br>  imports: [<br>    // ... other imports<br>    ReactiveComponentModule<br>  ]<br>})<br>export class MyFeatureModule {}</pre><p><strong>NgRx Component</strong> includes a pipe and a structural directive as helpers for your template.</p><h4>*ngrxLet structural directive</h4><p>The <strong>*ngrxLet</strong> directive serves as a convenient way of binding observables to a view context (a DOM element scope). It also helps with several internal processing under the hood. If you’re familiar with using the async pipe for reassignment, you’ve probably done this with the <strong>*ngIf</strong> directive:</p><pre>&lt;ng-container *ngIf=&quot;observableNumber$ | async as n&quot;&gt;<br>  &lt;app-number [number]=&quot;n&quot;&gt;<br>  &lt;/app-number&gt;<br>  &lt;app-number-special [number]=&quot;n&quot;&gt;<br>  &lt;/app-number-special&gt;<br>&lt;/ng-container&gt;</pre><p>The <strong>*ngrxLet</strong> directive allows you to safely work with observables in the template without extra destroying and recreating DOM elements.</p><pre>&lt;ng-container *ngrxLet=&quot;observableNumber$ as n&quot;&gt;<br>  &lt;app-number [number]=&quot;n&quot;&gt;<br>  &lt;/app-number&gt;<br>&lt;/ng-container&gt;</pre><pre>&lt;ng-container *ngrxLet=&quot;observableNumber$; let n&quot;&gt;<br>  &lt;app-number [number]=&quot;n&quot;&gt;<br>  &lt;/app-number&gt;<br>&lt;/ng-container&gt;</pre><h4>ngrxPush pipe</h4><p>The <strong>ngrxPush</strong> pipe serves as a drop-in replacement for the <strong>async</strong> pipe. It contains intelligent handling of change detection without any changes to the code.</p><pre>{{observable$ | ngrxPush}}</pre><pre>&lt;ng-container *ngIf=&quot;observable$ | ngrxPush as o&quot;&gt;{{o}}&lt;/ng-container&gt;</pre><pre>&lt;component [value]=&quot;observable$ | ngrxPush&quot;&gt;&lt;/component&gt;</pre><p>The <strong>ngrxPush</strong> pipe <em>schedules</em> change detection, allowing your more efficient control over rendering when new values are emitted.</p><p><a href="https://next.ngrx.io/guide/component"><strong>Read more</strong></a> about component in our documentation.</p><p><strong>NgRx Component</strong> puts us on a path for looking at new ways to build reactive Angular applications. It’s still considered <strong>experimental</strong> in the v10 release, but we are interested to hear your feedback on how to improve the experience for Angular developers. Thanks to <a href="https://twitter.com/michael_hladky"><strong>Michael Hladky</strong></a> for the original implementation, and to all the community for contributing feedback for this new package!</p><h3>New swag store and Discord Server!</h3><p>By popular request, you can now get official NgRx swag through our store! T-shirts with the NgRx logo are available in many different sizes, materials, and colors. We will look at adding new items to the store such as stickers, magnets, and more in the future. <a href="https://ngrx.threadless.com/">Visit our store</a> to get your NgRx swag today!</p><p>We’ve also added a <a href="https://discord.com/invite/gCEj4zC">discord server</a> for those who want to engage with other members of the NgRx community, old and new. You can sign up for an account here. We also still have a large community of users on the <a href="https://gitter.im/ngrx/platform">gitter channel</a> as well that provide continued help and support to our users.</p><h3>Breaking Changes</h3><p>This release contains breaking changes. For most of these breaking changes we’ve provided a migration that automatically runs when you upgrade your application with the Angular CLI command mentioned above.</p><p>Take a look at the <a href="https://ngrx.io/guide/migration/v10">version 10 migration guide</a> for complete information regarding migrating to the latest release. The complete <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">CHANGELOG</a> can be found on our <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">GitHub</a> page.</p><h3>Upgrading to NgRx 10</h3><p>To start using NgRx 10, make sure to have the following minimum versions installed:</p><ul><li>Angular version 10.x</li><li>Angular CLI version 10.0.1</li><li>TypeScript version 3.9.x</li><li>RxJS version 6.5.x</li></ul><p>NgRx supports using the Angular CLI ng update command to update your NgRx packages. To update your packages to the latest version, run the command:</p><pre>ng update @ngrx/store</pre><h3>Contributing to NgRx</h3><p>We’re always trying to improve the docs and keep them up-to-date. To help us, you can start contributing to NgRx. If you’re unsure where to start, come take a look at our new <a href="https://next.ngrx.io/contributing">contribution guide</a> and watch the <a href="https://www.youtube.com/watch?v=ug0c1tUegm4">introduction video</a> <a href="https://twitter.com/niklas_wortmann">Jan-Niklas Wortmann</a> and <a href="https://twitter.com/brandontroberts">Brandon Roberts</a> have made to help you get started.</p><h3>Thanks to all our contributors</h3><p>NgRx continues to be a community-driven project. Design, development, documentation, and testing all are done with the help of the community. We would like to thank the contributors that helped to work towards this release of NgRx: Michael Hladky, AdditionAddict, Jordan Powell, Keenan Johnson, Lance Finney, Lars Gyrup Brink Nielsen, Miroslav Jonas, Alan Donohoe, Ben Lesh, Brian Love, Christine Legge, Christoph Guttandin, Dillon Fearns, Emily Lam, Evgeny Fedorenko, Felix Lemke, Joshua Keel, Juan Herrera, Kevin Schuchard, Leon Marzahn, Maksym Kobieliev, Michael-James, Santosh Yadav, TheParad0X, Tobias Engelhardt, Wataru KASAHARA, aszechlicki, m00zi, ptouchton, treebeardcpu.</p><p>If you are interested in contributing, visit our <a href="https://github.com/ngrx/platform">GitHub</a> page and look through our open issues, some marked specifically for new contributors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*FRn8XhME-LzHH8lVA802cQ.png" /></figure><p>We would also like to give a big thanks to our silver sponsor, <a href="https://www.briebug.com/">BrieBug</a>. BrieBug is one of the top web and mobile application development consulting firms in the state of Colorado. BrieBug provides enterprise Angular consulting, architectural reviews, team training, and staff augmentation, with multiple Angular GDEs on staff. BrieBug was previously a bronze-level sponsor, but has since increased their sponsorship of NgRx development, providing further support for development, travel, and hosting expenses.</p><h3>Sponsor NgRx</h3><p>NgRx requires significant time and effort that often goes unpaid, and we would like to change that. If you or your company wants to sponsor continued development of NgRx, please visit our <a href="https://opencollective.com/ngrx">OpenCollective</a> page for different contribution options, buy some swag from our <a href="https://ngrx.threadless.com/">swag store</a>, or <a href="https://ngrx.io/about">contact us</a> directly for other sponsorship opportunities.</p><p>Follow us on <a href="https://medium.com/ngrx">Medium</a> and on <a href="https://twitter.com/ngrx_io">Twitter</a> for the latest updates about the NgRx platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/0*ta8oIux47oi-NTOV" /></figure><h3>More about NgRx Conf Sponsor — Nrwl and Nx:</h3><ul><li>Visit <a href="https://nx.dev/">Nx.dev</a> to get <a href="http://nrwl.io/">Nrwl.io</a>’s open-source toolkit for monorepo development.</li><li>Visit <a href="https://nx.app/">Nx.app</a>, to request access to Nx Cloud, and speed up your build-times by up to 90%! Take advantage of the <strong>free-tier</strong> to see the benefits.</li><li>Visit <a href="http://nxplaybook.com/">NxPlaybook.com</a> for free and paid Nx courses!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62bedda0be91" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/announcing-ngrx-version-10-new-packages-for-local-component-state-and-reactive-components-swag-62bedda0be91">Announcing NgRx Version 10: New packages for local component state and reactive components, swag…</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing NgRx Version 9: Immutability out of the box, customizable effects, and more!]]></title>
            <link>https://medium.com/ngrx/announcing-ngrx-version-9-immutability-out-of-the-box-customizable-effects-and-more-e4cf71be1a5b?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/e4cf71be1a5b</guid>
            <category><![CDATA[observables]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[ngrx]]></category>
            <dc:creator><![CDATA[Brandon Roberts]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 16:37:02 GMT</pubDate>
            <atom:updated>2020-03-10T19:05:53.622Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vweUSL7IrbiVchJS.png" /></figure><p>Today we’re happy to announce the version 9 release of the NgRx platform. This release contains new features across, bug fixes, and some breaking changes, all aimed at improving the developer experience when using NgRx libraries.</p><h3>Join Us at NgRx Conf 🚀!</h3><p>At its core, NgRx is about promoting a reactive approach within the Angular ecosystem. From routing, HTTP, forms, and state management, we love all things Reactive Angular! We are extending that passion to the community with the official announcement of <a href="https://conf.ngrx.io/">NgRx Conf</a>!</p><p>🔥2 Days<br>📅 20 Speakers<br>🚀 200 Attendees<br>November 5–6, 2020 at the <a href="https://twitter.com/RocketCenterUSA">Space and Rocket Center</a> in Huntsville, AL</p><p>NgRx Conf is a celebration of all things Reactive Angular. Come join us and learn from some of the best speakers in the Angular community about your favorite reactive topics!</p><p><a href="https://ti.to/ngrx-conf/2020">Tickets are now on sale!</a></p><p>Follow <a href="https://twitter.com/NgRxConf">@NgRxConf</a> for future updates!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldGay1NZeYPh3DU-Z4q7Dg.png" /></figure><h4>NgRx Conf’s Premier Sponsor</h4><p>We also welcome <a href="https://nrwl.io/">Nrwl</a> as our premier sponsor for NgRx Conf! Nrwl has been a longtime promoter of NgRx as a tool when building large applications in Angular, and we couldn’t be more excited to have them partner with us for NgRx Conf.</p><p>With Nrwl, you’ll find a consulting firm that truly enables you to get a deeper understanding and navigate the most nuanced challenges of building software with Angular, React, and other modern Javascript frameworks.</p><p>Comprised of former Angular team members, Googlers, and renowned experts, when working with us, you’ll build software better and faster. You can leverage our consulting, training, and engineering, plus open-source tools like <a href="https://nx.dev/">Nx</a> to elevate your enterprise’s development practice.</p><h3>Immutability out of the box</h3><p>Runtime checks for immutability and serializability were introduced in version 8, to aid developers in maintaining best practices when managing state. Two of these runtime checks, strictStateImmutability, and strictActionImmutability are now enabled by default in development, so developers can be assured that their state following immutable practices out of the box.</p><p>There is also a new runtime check for validating that actions are dispatched from within the Angular zone. If you’re dealing with less modern web APIs, such as jQuery, that operate outside the Angular zone, this check helps you catch bugs that would occur because of bypassed Angular change detection.</p><pre><a href="http://twitter.com/NgModule">@NgModule</a>({<br>  imports: [<br>    StoreModule.forRoot(reducers, {<br><strong>      runtimeChecks: {<br>        strictActionWithinNgZone: true,<br>      },</strong><br>    }),<br>  ],<br>})<br>export class AppModule {}</pre><p>Thanks to <a href="https://twitter.com/cooperdev">Stephen Cooper</a> for contributing to this feature!</p><h3>Creators syntax is now the default!</h3><p>The new creators syntax, <a href="https://medium.com/ngrx/announcing-ngrx-version-8-ngrx-data-create-functions-runtime-checks-and-mock-selectors-a44fac112627">announced in version 8</a> is now the default for all schematics in version 9. The new syntax allows you to get up and running quickly with less code, and more type-safety. If you are still using the previous syntax, support for it is also still available.</p><p>Read our <a href="https://ngrx.io/guide/schematics">docs</a>, and check out our <a href="https://github.com/ngrx/platform/tree/master/projects/example-app">example application</a> if you haven’t tried out the new syntax already.</p><h3>Customizable re-subscriptions for Effects</h3><p>Also introduced in version 8, was the ability to resubscribe to an observable inside an Effect when an error occurs. In version 9, we limit this behavior to 10 retries, and offer the ability to customize the re-subscription behavior according to your needs.</p><pre>@NgModule({<br>  imports: [EffectsModule.forRoot([MovieEffects])],<br>  providers: [<br>    {<br>      provide: EFFECTS_ERROR_HANDLER,<br>      useValue: customEffectResubscriptionHandler,<br>    },<br>    <br>  ],<br>})<br><br>// adjust the number of retries<br>const CUSTOM_NUMBER_OF_RETRIES = 100; <br><br>export function customEffectResubscriptionHandler&lt;T extends Action&gt;(<br>  observable$: Observable&lt;T&gt;,<br>  errorHandler: CustomErrorHandler<br>): Observable&lt;T&gt; {<br>  return defaultEffectsErrorHandler(<br>    observable$,<br>    errorHandler,<br>    CUSTOM_NUMBER_OF_RETRIES<br>  );<br>}</pre><p>Thanks to <a href="https://twitter.com/zak">Zak Henry</a> for contributing to this feature!</p><h3>Breaking Changes</h3><p>This release contains breaking changes. For most of these breaking changes we’ve provided a migration that automatically runs when you upgrade your application with the Angular CLI command mentioned above.</p><p>Take a look at the <a href="https://ngrx.io/guide/migration/v9">version 9 migration guide</a> for complete information regarding migrating to the latest release. The complete <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">CHANGELOG</a> can be found on our <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">GitHub</a> page.</p><h3>Upgrading to NgRx 9</h3><p>To start using NgRx 9, make sure to have the following minimum versions installed:</p><ul><li>Angular version 9.x</li><li>Angular CLI version 9.0.1</li><li>TypeScript version 3.7.x</li><li>RxJS version 6.5.x</li></ul><p>NgRx supports using the Angular CLI ng update command to update your NgRx packages. To update your packages to the latest version, run the command:</p><pre>ng update @ngrx/store</pre><h3>Contributing to NgRx</h3><p>We’re always trying to improve the docs and keep them up-to-date. To help us, you can start contributing to NgRx. If you’re unsure where to start, come take a look at our new <a href="https://next.ngrx.io/contributing">contribution guide</a> and watch the <a href="https://www.youtube.com/watch?v=ug0c1tUegm4">introduction video</a> <a href="https://twitter.com/niklas_wortmann">Jan-Niklas Wortmann</a> and <a href="https://twitter.com/brandontroberts">Brandon Roberts</a> have made to help you get started.</p><h3>Thanks to all our contributors</h3><p>NgRx continues to be a community-driven project. Design, development, documentation, and testing all are done with the help of the community. We would like to thank the contributors that helped to work towards this release of NgRx: Kyle Cannon, Dmytro Gokun, David Taylor, Hadrien TOMA, AdditionAddict, Kevin Schuchard, ttestman4, shikhin21, Reto Ryter, Akihito Tamagawa, Lefteris Tsallas, Dmitry Teplov, Suguru Inatomi, Gregor Woiwode, Kumaresh C J, Stephen Cooper, Yousuf Jawwad, Zak Henry, Santosh Yadav, Elvis Sun, Evgeny Fedorenko, Carlos Esteban Lopez Jaramillo, erhise, Jordan, Allistair Vilakazi, Jeffrey Bosch, Sumit Parakh, Ilya, Miroslav Jonaš, sanketCactus, Maarten Tibau, bert2, Alan Agius, Artur Androsovych, Koala, joebobfisher, Eddie Tisma, Joe Mason, Haijin He, John Cao, Sam Lin, Andrey Chalkin, Riley Littlefield, Felipe Norato Lacerda, Peter B Smith, John Crowson, jayoungers, Kadamas, Georgi Parlakov, Christoph Guttandin, Jason Hodges, David Bottiau, Christina Braun, Siyang Kern Zhao, Sheila Leverson, MJ Meyer, Gugan Arumugam, EV, Raphael Fuchs, Leonardo Ruhland, Kamran Asif, Marcin Majkowski, mxdmedia, Ryan Streur, Bitcollage, Benjamin Blackwood, tja4472, George Kamtziridis, Marvin Luchs, Mark Grealish, Cédric DUFFOURNET, peterreisz, Wilson Hobbs, Mark, Jon, Elad Cohen, James Hollowell, Itay Oded, ijz953, Michael Randers-Pehrson, Jon Rimmer, Tim Cigrand, Asiel Leal Celdeiro, Robert Gunczer, Pierre-Edouard Galtier, JiaLiPassion, strawbrary, and Ferdinand Malcher.</p><p>If you are interested in contributing, visit our <a href="https://github.com/ngrx/platform">GitHub</a> page and look through our open issues, some marked specifically for new contributors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*FRn8XhME-LzHH8lVA802cQ.png" /></figure><p>We would also like to give a big thanks to our silver sponsor, <a href="https://www.briebug.com/">BrieBug</a>. BrieBug is one of the top web and mobile application development consulting firms in the state of Colorado. BrieBug provides enterprise Angular consulting, architectural reviews, team training, and staff augmentation, with multiple Angular GDEs on staff. BrieBug was previously a bronze-level sponsor, but has since increased their sponsorship of NgRx development, providing further support for development, travel, and hosting expenses.</p><h3>Sponsor NgRx</h3><p>NgRx requires significant time and effort that often goes unpaid, and we would like to change that. If you or your company wants to sponsor continued development of NgRx, please visit our <a href="https://opencollective.com/ngrx">OpenCollective</a> page for different contribution options or contact us directly for other sponsorship opportunities.</p><p>Follow us on <a href="https://medium.com/ngrx">Medium</a> and on <a href="https://twitter.com/ngrx_io">Twitter</a> for the latest updates about the NgRx platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/0*ta8oIux47oi-NTOV" /></figure><h3><strong>More about NgRx Conf Sponsor — Nrwl and Nx:</strong></h3><ul><li>Visit <a href="https://nx.dev/">Nx.dev</a> to get <a href="http://nrwl.io/">Nrwl.io</a>’s open-source toolkit for monorepo development.</li><li>Visit <a href="https://nx.app/">Nx.app</a>, to request access to Nx Cloud, and speed up your build-times by up to 90%!</li><li>Visit <a href="http://nxplaybook.com/">NxPlaybook.com</a> for free and paid Nx courses!</li></ul><figure><a href="http://nx.dev/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pbElIZt9YeORNw8m142z6w.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4cf71be1a5b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/announcing-ngrx-version-9-immutability-out-of-the-box-customizable-effects-and-more-e4cf71be1a5b">Announcing NgRx Version 9: Immutability out of the box, customizable effects, and more!</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing NgRx Version 8: @ngrx/data, create functions, runtime checks and mock selectors]]></title>
            <link>https://medium.com/ngrx/announcing-ngrx-version-8-ngrx-data-create-functions-runtime-checks-and-mock-selectors-a44fac112627?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/a44fac112627</guid>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Tim Deschryver]]></dc:creator>
            <pubDate>Mon, 10 Jun 2019 18:27:01 GMT</pubDate>
            <atom:updated>2019-08-28T05:34:24.358Z</atom:updated>
            <content:encoded><![CDATA[<h3>Announcing NgRx Version 8: @ngrx/data, creator functions, run-time checks, and isolated tests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lvCBhpL6Qy9O4u7-yvr5ug.png" /></figure><p>Today we’re happy to announce the version 8 release of the NgRx platform. This release contains a lot of new features across most of the libraries, bug fixes, and some breaking changes, all aimed at improving the developer experience when using NgRx libraries.</p><h3><strong>@ngrx/data</strong></h3><p>The long-awaited <a href="https://github.com/johnpapa/angular-ngrx-data">angular-ngrx-data</a> library by <a href="https://twitter.com/John_Papa">John Papa</a> and <a href="https://twitter.com/wardbell">Ward Bell</a> has been integrated into the platform as a first-party package. NgRx Data is an extension that offers a gentle introduction to NgRx by simplifying the management of entity data while reducing the amount of explicitness.</p><p>For more info head over to the <a href="https://ngrx.io/guide/data">docs</a>.</p><h3><strong>@ngrx/store</strong></h3><h4>createAction, actions without enums, classes and union types</h4><p>In previous versions of NgRx in order to create an action, you had to create an action type, create a class, and lastly, create an action union. Because we encourage the use of <a href="https://www.youtube.com/watch?v=JmnsEvoy-gY">Good Action Hygiene</a>, introduced by <a href="https://twitter.com/MikeRyanDev">Mike Ryan</a>, we had to come up with an easier way to create unique actions.</p><p>To allow you to create actions in a less verbose way, we’re introducing the createAction factory function. The first parameter of the createAction function is the action type, the optional second parameter are the extra metadata, or `props` of the action.</p><p>To compare both, the below image illustrates how you can use the new createAction function on the left and on the right there is the current way of creating actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZ5jtJUvgcxEK3YXTnD4Mg.png" /><figcaption>An image comparing both ways to create actions</figcaption></figure><p>It’s also possible to use a function as the second parameter, this allows you to put logic inside the action creators.</p><pre>export const addBook = createAction(<br>  &#39;[View Book Page] Add book&#39;,<br>  ({ bookId, amount = 1 }: { bookId: number; amount: number }) =&gt; ({<br>    bookId,<br>    amount: amount &lt;= 0 ? 1 : amount,<br>    timestamp: Date.now,<br>  })<br>)</pre><p>createAction is a factory function that returns a function, called an ActionCreator, which returns an Action object when called. To dispatch an action, you have to invoke the ActionCreator:</p><pre>this.store.dispatch(<strong>addBook({ bookId: 47 })</strong>);</pre><p>We refactored the <a href="https://github.com/ngrx/platform/blob/master/projects/example-app/src/app/books/actions/collection-api.actions.ts">example-app</a> to use createAction to give an idea of how it looks like and what is possible with it. For an in-depth look, see a previous post <a href="https://blog.angularindepth.com/ngrx-action-creators-redesigned-d396960e46da">NgRx: Action Creators redesigned</a> by Alex Okrushko.</p><h4>createReducer, a reducer without the switch case</h4><p>The new createReducer function allows to create a reducer without a switch statement. It uses the on function to make a distinction between the action types, and returns a new reference of the state. As you can see in the image below, it isn’t needed to handle a default case for unhandled actions in the reducer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*goeepP1SbM8v1WZ8Yh3JJA.png" /><figcaption>An image comparing both ways to create reducers</figcaption></figure><p>We refactored the <a href="https://github.com/ngrx/platform/blob/master/projects/example-app/src/app/books/reducers/collection.reducer.ts">example-app</a> to use createReducer to give an idea on how it looks like and what is possible with it.</p><h4>More safety with runtime checks</h4><p>To guide developers to follow the NgRx core concepts and best practices, we have added a four (4) runtime checks. They are here to shorten the feedback loop of easy-to-make mistakes when you’re starting to use NgRx, or even a well-seasoned developer might make. These checks are opt-in and can be enabled via the config of the root store.</p><p>The four (4) checks that are currently available are:</p><ul><li>strictStateImmutability: to verify that the state isn’t mutated</li><li>strictActionImmutability: to verify that actions aren’t mutated</li><li>strictStateSerializability: to verify if the state is serializable</li><li>strictActionSerializability: to verify if the actions are serializable</li></ul><pre><a href="http://twitter.com/NgModule">@NgModule</a>({<br>  imports: [<br>    StoreModule.forRoot(reducers, {<br><strong>      runtimeChecks: {<br>        </strong><strong>strictStateImmutability: true,<br>        </strong><strong>strictActionImmutability: true,<br>        strictStateSerializability: true,<br>        strictActionSerializability: true,<br>      },</strong><br>    }),<br>  ],<br>})<br>export class AppModule {}</pre><blockquote>These runtime checks are a replacement for the ngrx-store-freeze package.</blockquote><p>For more info head over to the <a href="https://ngrx.io/guide/store/configuration/runtime-checks">docs</a>.</p><h4>Isolated tests with mock selectors</h4><p>In NgRx version 7, we introduced MockStore but this didn’t allow to create fully isolated unit tests. With mock selectors, in combination with MockStore this becomes possible. These mock selectors are available via @ngrx/store/testing. To provide selectors, define them while providing the MockStore via the selectors property which accepts an array of mock selectors.</p><pre>import { provideMockStore, MockStore } from &#39;@ngrx/store/testing&#39;;</pre><pre>TestBed.configureTestingModule({<br>  providers: [<br>    provideMockStore({<br>  <strong>    selectors: [<br>        { selector: fromBooks.getSearchQuery, value: &#39;&#39; },<br>        { selector: fromBooks.getSearchResults, value: [] },<br>        { selector: fromBooks.getSearchLoading, value: false },<br>        { selector: fromBooks.getSearchError, value: &#39;&#39; },<br>      ],</strong><br>    }),<br>  ],<br>});</pre><p>It’s also possible to define or override a selector with the new overrideSelector function on MockStore. The first parameter of overrideSelector is the selector function, the second parameter is the result.</p><pre>const store: MockStore = TestBed.get(Store);<br>store.overrideSelector(fromBooks.getSearchResults, [])</pre><p>Besides creating mocked selectors via the mocked stored it’s also possible to set the result of a selector without the use of MockStore. By using the the setResult function of a selector, we skip the selector’s invocation and simply return set result. The setResult function expects the result as parameter.</p><pre>fromBooks.getSearchResults.setResult([]);</pre><p>Thanks to <a href="https://twitter.com/john_crowson">John Crowson</a> for working on this feature. For more info head over to the <a href="https://ngrx.io/guide/store/testing#using-mock-selectors">docs</a>.</p><h3>@ngrx/effects</h3><h4>createEffect for type safety</h4><p>As alternative to the @Effect() decorator, NgRx 8 provides the createEffect function. The advantage of using createEffect is that it’s type safe, if the effect does not return an Observable&lt;Action&gt; it will give compile errors. The option { dispatch: false } still exists for effects that don’t dispatch new Actions, adding this option also removes the restriction that an effect needs to return an Observable&lt;Action&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vzp9di4vAuDSVmZOnCVGJA.png" /><figcaption>An image comparing both ways to create effects</figcaption></figure><p>We refactored the <a href="https://github.com/ngrx/platform/blob/master/projects/example-app/src/app/books/effects/collection.effects.ts">example-app</a> to use createEffect to give an idea on how it looks like and what is possible with it.</p><h4>Automatically resubscribe on error, a safety net</h4><p>Many effects are used to call API services and most of the time they result in Success or Error actions. For the Error actions we noticed that this path is often not handled, or is handled incorrectly. When this happens the Effect will silently be destroyed.</p><p>Starting from NgRx 8 we will, by default, automatically resubscribe to the effect when this happens. This adds a safety net for where the unhappy paths were missed.</p><p>It’s possible to turn this feature off by setting resubscribeOnError to false at the effect level.</p><pre><em>// with createEffect</em><br>login$ = createEffect(() =&gt; ...), { <strong>resubscribeOnError: false</strong> });</pre><p>For more info, head over to the <a href="https://ngrx.io/guide/effects/lifecycle#resubscribe-on-error">docs</a>.</p><h3>@ngrx/router-store</h3><h4>RouterState.Minimal, a fully serializable router-store</h4><p>To make use of the serializability runtime checks a fully serializable router state is needed. To enable this we have provided a routerState config property on the router store config. To turn this feature on, set the routerState config to RouterState.Minimal . The default value is RouterState.Full and will use the current DefaultRouterSerializer to serialize the Angular router events.</p><pre>StoreRouterConnectingModule.forRoot({<br>  <strong>routerState: RouterState.Minimal,</strong><br>});</pre><p>For more info head over to the <a href="https://next.ngrx.io/guide/router-store/configuration">docs</a>.</p><h4>Router selectors, a set of common selectors</h4><p>Often, when working with @ngrx/router-store there’s a need to select data from its state. With these new selectors, you can select the most common data from the router state. If you’re familiar to the <a href="https://ngrx.io/guide/entity/adapter#entity-selectors">entity selectors</a>, these new router selectors will look familiar.</p><pre>export const selectRouter = createFeatureSelector&lt;<br>  State,<br>  fromRouter.RouterReducerState&lt;any&gt;<br>&gt;(&#39;router&#39;);</pre><pre>const {<br>  selectQueryParams,    // select the current route query params<br>  selectRouteParams,    // select the current route params<br>  selectRouteData,      // select the current route data<br>  selectUrl,            // select the current url<br>} = getSelectors(selectRouter);</pre><p>Thanks to <a href="https://twitter.com/_jasonhodges">Jason Hodges</a> for working on this feature. For more info head over to the <a href="https://ngrx.io/guide/router-store/selectors#router-selectors">docs</a>.</p><h3>Schematics</h3><p>The schematics for the above create functions are ready to use but are currently opt-in. To use them, use the creators flag:</p><pre>ng generate @ngrx/schematics:action ActionName --creators<br>ng generate @ngrx/schematics:reducer ReducerName --creators<br>ng generate @ngrx/schematics:effect EffectName --creators<br>ng generate @ngrx/schematics:entity EntityName --creators<br>ng generate @ngrx/schematics:feature FeatureName --creators</pre><p>Thanks to <a href="https://twitter.com/ItayOded">Itay Oded</a> for working on this feature. For more info head over to the <a href="https://ngrx.io/guide/schematics">docs</a>.</p><h3>Visual Studio Code Snippets</h3><p>To further enhance developer ergonomics, we have contributed a series of NgRx snippets to the Angular Snippets VS Code extension by John Papa. These snippets are all prefixed with a-ngrx-* and provide a convenient way to quickly generate actions, reducers, effects and selectors using the new version 8 syntax.</p><p>More information on the extension and snippets can be found at <a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2">Angular Snippets (Version 8)</a>.</p><h3>Team updates</h3><p>Our team keeps on growing, this time we are happy to announce that <a href="https://twitter.com/AlexOkrushko">Alex Okrushko</a> and <a href="https://twitter.com/wesgrimes">Wes Grimes</a> are joining the NgRx team. With Alex and Wes joining the team we can provide better support, maintain and grow our docs at <a href="http://ngrx.io/">ngrx.io</a>, and continue to build out the platform. We also welcome new ideas, so if you have any, feel free to <a href="https://github.com/ngrx/platform/issues/new/choose">open an issue</a>.</p><h3>Upgrading to NgRx 8</h3><p>To start using NgRx 8, make sure to have the following minimum versions installed:</p><ul><li>Angular version 8.x</li><li>Angular CLI version 8.0.2</li><li>TypeScript version 3.4.x</li><li>RxJS version 6.4.0</li></ul><p>NgRx supports using the Angular CLI ng update command to update your NgRx packages. To update your packages to the latest version, run the command:</p><pre>ng update @ngrx/store</pre><p>For an easy transition coming from ngrx-data to @ngrx/data install this package via the Angular CLI ng add command:</p><pre>ng add @ngrx/data --migrate</pre><h4>Breaking changes</h4><p>This release has a couple of breaking changes. For most of these breaking changes we’ve provided a migration that automatically runs when you upgrade your application with the Angular CLI commands above.</p><p>Below you can find a rundown of the breaking changes, for more info and guidance, take a look at the <a href="https://ngrx.io/guide/migration/v8">V8 migration guide</a>. The complete <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">CHANGELOG</a> can be found on our <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">GitHub</a> page.</p><p><strong>@ngrx/store</strong></p><ul><li>The META_REDUCERS token has been renamed to USER_PROVIDED_META_REDUCERS. The META_REDUCERS token has become a multi token and can be used by library authors</li><li>Selectors with only a projector function aren’t valid anymore, this change will make the usage of selectors more consistent</li><li>The return type of the createSelectorFactory and createSelector functions are now a MemoizedSelector instead of a Selector</li><li>The ngrx-store-freeze package has been deprecated in favor of runtime checks</li></ul><p><strong>@ngrx/router-store</strong></p><ul><li>Usage of forRoot is now required for StoreRouterConnectingModule</li></ul><p><strong>@ngrx/entity</strong></p><ul><li>add undefined to Dictionaries index signature, dictionary could be producing undefined but previous typings were not explicit about it</li><li>If an error occurs (or is flattened) in the main effect’s pipe then it will be <br>reported and the effect is resubscribed automatically</li></ul><p><strong>@ngrx/store-devtools</strong></p><ul><li>actionsWhitelist is renamed to actionsSafelist</li><li>actionsBlacklist is renamed to actionsBlocklist</li></ul><p><strong>@ngrx/data</strong></p><ul><li>NgrxDataModule is renamed to EntityDataModule</li><li>NgrxDataModuleWithoutEffects is renamed to EntityDataModuleWithoutEffects</li><li>NgrxDataModuleConfig is renamed to EntityDataModuleConfig</li></ul><h3><strong>Collaboration to support diversity and inclusion</strong></h3><p>Open source provides many opportunities for people of diverse backgrounds to contribute to tech. With This Dot’s <a href="https://medium.com/@thisdotmedia/a-new-approach-to-changing-the-ratio-in-tech-breaking-barriers-through-open-source-21c31bacd69b">Open Source Apprentice Program</a>, led co-founder <a href="https://twitter.com/ladyleet">Tracy Lee</a>, we collaborated with <a href="https://twitter.com/essentialcode20">Marien Scott</a>, with mentorship provided by <a href="https://twitter.com/myspivey">James Spivey</a> to incorporate visual testing of our example application using Applitools. This effort was a success and shows the potential that can be achieved when providing opportunities to under-represented minorities in tech. If your company is interested in taking part in these efforts to change the ratio, visit <a href="https://www.thisdot.co/">ThisDot</a>, and <a href="https://www.thisdot.co/hirethefempire">hire the fempire</a>.</p><h3>Contributing to NgRx</h3><p>We’re always trying to improve the docs and keep them up-to-date. To help us, you can start contributing to NgRx. If you’re unsure where to start, come take a look at our new <a href="https://next.ngrx.io/contributing">contribution guide</a> and watch the <a href="https://www.youtube.com/watch?v=ug0c1tUegm4">introduction video</a> <a href="https://twitter.com/niklas_wortmann">Jan-Niklas Wortmann</a> and <a href="https://twitter.com/brandontroberts">Brandon Roberts</a> have made to help you get started.</p><h3>Thanks to all our contributors</h3><p>NgRx continues to be a community-driven project. Design, development, documentation, and testing all are done with the help of the community. We would like to thank the contributors that helped to work towards this release of NgRx: John Crowson, Santosh Yadav, Jason Hodges, Itay Oded, Minijus L, EV, tja4472, Ismail Faizi, Alex Eagle, Serkan Sipahi, Felix Lemke, Paul King, Nacho Vazquez, Suguru Inatomi, Ferdinand Malcher, Justin Schwartzenberger, Karanveer Plaha, Koala, Marien Scott, Michael, Nils Mehlhorn, Peter B Smith, Emilio Martinez, Monsij Biswal, Alfonso Andrés López Molina, Eddybrando Vásquez, Sheik Althaf, Stas Vladykov, Stephan Renatus, ukrukarg, Dkosasih, Di Zhou, beqa7137, erhise, geraldspreer, jfrazx, musou1500, shikhin21, thefliik, Andrew Evans, Adrian Fâciu, Evgeny Fedorenko, Fabian Gosebrink, Gregor Woiwode, Felix Mohammadi Kho’i, Hermel, pegaltier, Guilherme Oenning, JiaLiPassion</p><p>If you are interested in contributing, visit our <a href="https://github.com/ngrx/platform">GitHub</a> page and look through our open issues, some marked specifically for new contributors.</p><p>The createAction and createReducer functions are inspired by the <a href="https://github.com/cartant/ts-action">ts-action</a> library, created by <a href="https://twitter.com/ncjamieson">Nicholas Jamieson</a>.</p><p>We would also like to give a big thanks to our silver sponsor, <a href="https://www.briebug.com/">BrieBug</a>. BrieBug is one of the top web and mobile application development consulting firms in the state of Colorado. BrieBug provides enterprise Angular consulting, architectural reviews, team training, and staff augmentation, with multiple Angular GDEs on staff. BrieBug was previously a bronze-level sponsor, but has since increased their sponsorship of NgRx development, providing further support for development, travel, and hosting expenses.</p><h3>Support NgRx</h3><p>NgRx requires significant time and effort that often goes unpaid, and we would like to change that. If you or your company wants to contribute to NgRx as a backer or sponsor, please visit our <a href="https://opencollective.com/ngrx">OpenCollective</a> page for different contribution options or contact us directly for other sponsorship opportunities.</p><p>Follow us on <a href="https://medium.com/ngrx">Medium</a> and on <a href="https://twitter.com/ngrx_io">Twitter</a> for the latest updates about the NgRx platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a44fac112627" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/announcing-ngrx-version-8-ngrx-data-create-functions-runtime-checks-and-mock-selectors-a44fac112627">Announcing NgRx Version 8: @ngrx/data, create functions, runtime checks and mock selectors</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing NgRx Version 7 — Docs, Testing, and more]]></title>
            <link>https://medium.com/ngrx/announcing-ngrx-version-7-docs-testing-and-more-b43eee2795a4?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/b43eee2795a4</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[ngrx]]></category>
            <dc:creator><![CDATA[@ngrx]]></dc:creator>
            <pubDate>Mon, 22 Apr 2019 15:49:32 GMT</pubDate>
            <atom:updated>2019-01-21T17:08:11.449Z</atom:updated>
            <content:encoded><![CDATA[<h3>Announcing NgRx Version 7 — Docs, Testing, and more</h3><p>Today we are announcing the version 7 release of the NgRx platform. This release contains bug fixes, new features, and some breaking changes, all aimed at improving the developer experience when using NgRx libraries. There are also updates to announcements with version 6.</p><p><strong>Official Docs<br></strong>In case you haven’t noticed already, NgRx has an official documentation site at <a href="https://ngrx.io/">https://ngrx.io</a>! The documentation site is a PWA built with Angular using a similar infrastructure, look, and feel to what you see on the <a href="https://angular.io/">Angular docs</a>. This has been a long-awaited feature, and will give us a space for tutorials, guides, real-world examples, and recipes covering advanced topics. We will continue to add new content to the documentation site that will help developers learn the “why” behind NgRx and the “how” when using it.</p><p>Contributing is also very simple, as you can edit any page using the pencil icon in the top right corner of each page. This opens a GitHub editor where you can edit the markdown files quickly and submit pull requests. Previews of your changes are generated with your pull request for quicker feedback and turnaround. All of the existing documentation has been moved to the new site, along with a new tutorial, and refreshed guides! Be sure to check out the site at <a href="https://ngrx.io/">https://ngrx.io</a>. Feel free to file new issues and feature requests for the docs on our <a href="https://github.com/ngrx/platform">GitHub</a> page.</p><p><strong>Breaking Changes<br></strong>Deprecated in version 6.1, the <strong>ofType</strong> method on the <strong>Actions</strong> class in @ngrx/effects class was removed. This change was made to align with the pipeable operators introduced in RxJS V6.</p><p>Before:</p><pre>import { Effect, Actions } from &#39;<a href="http://twitter.com/ngrx/effects">@ngrx/effects</a>&#39;;</pre><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class MyEffects {<br>  <a href="http://twitter.com/Effect">@Effect</a>()<br>  someEffect$: Observable&lt;Action&gt; = this.actions$<br>    .ofType(UserActions.LOGIN)<br>    .pipe(map(() =&gt; new AnotherAction()));</pre><pre>  constructor(private actions$: Actions) {}<br>}</pre><p>After:</p><pre>// import ofType operator<br>import { Effect, Actions, ofType } from &#39;<a href="http://twitter.com/ngrx/effects">@ngrx/effects</a>&#39;;</pre><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class MyEffects {<br>  <a href="http://twitter.com/Effect">@Effect</a>()<br>  someEffect$: Observable&lt;Action&gt; = this.actions$.pipe(<br>    ofType(UserActions.LOGIN), // use the pipeable ofType operator<br>    map(() =&gt; new AnotherAction())<br>  );</pre><pre>  constructor(private actions$: Actions&lt;UserActions&gt;) {}<br>}</pre><p>This along with the addition of a generic type to the Actions class provides a more type-safe way to infer the type of the actions in your effects class.We have released <a href="https://www.npmjs.com/package/ngrx-tslint-oftype">a standalone tool</a> to aid you in your migration to the new operator syntax. We are also exploring the option of a migration integrated with the Angular CLI to make this transition easier. As with each major release, we have also updated to the Angular V7 and RxJS 6.3 dependencies. Updating all your packages to the latest version can be done using the Angular CLI command, ng update.</p><pre>ng update @ngrx/store</pre><p>There are additional minor breaking changes with the necessary changes listed in our <a href="https://ngrx.io/guide/migration/v7">V7 migration guide</a>.</p><p><strong>New Features<br></strong>We also introduced some new features in version 7 across many of the NgRx libraries including deeper integration with the Angular CLI, more support for the Redux Devtools Extension features, and testing just to name a few. Many of these features were requested and developed by community contributors. Some of the highlighted features are listed below.</p><p><strong>Store</strong></p><p>Selector Props<br>In V7, we introduced two new features for interacting with the Store during development and testing. Now with selectors, you can use props to provide additional information needed for computing data models. Whether you need to pass an id from the router, or provide some static data, props give you this functionality with a selector out of the box.</p><p>Create a selector that uses props:</p><pre>export const getCount = <a href="https://ngrx.io/api/store/createSelector">createSelector</a>(<br>getCounterValue,<br>(counter, props) =&gt; counter * props.multiply);</pre><p>And define the props in the select operator:</p><pre>this.store.pipe(<a href="https://ngrx.io/api/store/select">select</a>(fromRoot.getCount, { multiply: 2 }))</pre><p>Testing Package<br>In an effort to make testing using Store easier, we have added a testing package for mocking out the state used by the Store. The <strong>provideMockStore()</strong> method allows you to provide a mock store to push state changes during unit testing as an alternative to providing your reducers. Now you can completely test your Store-aware components and effects in isolation with less setup.</p><pre>import { Store } from &#39;@ngrx/store&#39;;<br>import { provideMockStore, MockStore } from &#39;@ngrx/store/testing&#39;;<br>import { take } from &#39;rxjs/operators&#39;;</pre><pre>describe(&#39;Mock Store&#39;, () =&gt; {<br>  let mockStore: MockStore&lt;{ counter1: number, counter2: number }&gt;;</pre><pre>  beforeEach(() =&gt; {<br>    const initialState = { counter1: 0, counter2: 1 };</pre><pre>    TestBed.configureTestingModule({<br>      providers: [<br>        provideMockStore({ initialState })<br>      ],<br>    });</pre><pre>    mockStore = TestBed.get(Store);<br>  });</pre><pre>  it(&#39;should set the new state&#39;, () =&gt; {<br>    mockStore.setState({ counter1: 1, counter2: 2 });</pre><pre>    mockStore.pipe(take(1)).subscribe(state =&gt; {<br>      expect(state.counter1).toBe(1);<br>    });<br>  });<br>});</pre><p><strong>Effects</strong></p><p>Lifecycle hooks<br>To give more insight into the Effects lifecycle, we introduced new lifecycle interfaces, <em>OnInitEffects</em> and <em>OnIdentifyEffects</em>. When implemented on your effects class, the OnInitEffects lifecycle method is called after the effects are registered.</p><p>Here you can provide any initialization logic, and return an action that is dispatched to the store.</p><pre>import { OnInitEffects } from &#39;@ngrx/effects&#39;;</pre><pre>class UserEffects implements OnInitEffects {<br>  ngrxOnInitEffects(): Action {<br>    return { type: &#39;[UserEffects]: Init&#39; };<br>  }<br>}</pre><p>The <em>OnIdentifyEffects</em> is a more advanced hook that gives you control over unique instances of your Effects classes. For each unique identifier, a separate instance effect is created.</p><pre>import { OnIdentifyEffects } from &#39;@ngrx/effects&#39;;</pre><pre>class EffectWithIdentifier implements OnIdentifyEffects {<br>  constructor(private effectIdentifier: string) {}</pre><pre>ngrxOnIdentifyEffects() {<br>    return this.effectIdentifier;<br>  }<br>}</pre><p><strong>Entity</strong></p><p>New Adapter Methods<br>Entity is all about managing collection, so we updated and additional adapter methods to use when dealing with collections, including mapping, removing, and deleting entities. The map method is similar to the Array.map method, iterating over your collection, allowing you to make updates to entities in your collection using a predicate function. The updateMany and removeMany methods now also support a predicate method to give you more control over which entities to update and remove based on a predicate function.</p><p><strong>Router Store</strong></p><p>New Actions<br>To further integrate with the Angular Router, we have introduced new actions that provide more information about the state of the router in your store. The new actions include when the router has started a new navigation, as well as when a navigation cycle has successfully completed. This gives you access to more of the router state after guards and resolvers have finished running. All these new actions are provided with more descriptive action types for the existing actions, so you can easily glance at the developer tools to see when the actions are triggered.</p><p><strong>Store Devtools</strong></p><p>Extension features<br>To enhance developer productivity with the Redux Devtools Extension, we have added support for more extension features, including blacklisting and white-listing of actions, persisting state across page reloads, locking, and pausing of the extension. The new options are fully configurable through the StoreDevtools instrumentation, giving you the flexibility to turn features on and off as needed.</p><p>To see the full list of new features, look at our release <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">changelog</a>.</p><p><strong>Updates</strong></p><p>NgRx Data<br>With V6, we <a href="https://medium.com/ngrx/announcing-the-release-of-ngrx-6-new-projects-and-looking-ahead-5fc30bed260b">announced</a> that <a href="https://blog.angularindepth.com/@timdeschryver">Tim Deschryver,</a> John Papa and Ward Bell were joining the NgRx team delivering high-quality libraries for the platform. We are continuing to work with John and Ward to integrate the <a href="https://github.com/johnpapa/angular-ngrx-data">ngrx-data</a> library officially into the platform as a first-party package. NgRx Data provides an out of the box solution for managing large sets of entity collections with external APIs, simple configuration, and customization options. Along with integrating NgRx Data, are still working on new APIs for server-side rendering, serialization, and exploring new functionality that will be provided with the Ivy renderer in Angular. We also welcome new ideas, so if you have any, feel free to <a href="https://github.com/ngrx/platform/issues/new/choose">open an issue</a>.</p><p><strong>Official NgRx Workshop!<br></strong>The NgRx team will be at <a href="https://ng-conf.org/">ng-conf 2019</a> in a big, albeit different way this year! Last year, we were part of a complete fair-day track during ng-conf dedicated to NgRx and its ecosystem. This year we will be providing an official workshop! The “NgRx: A Reactive State of Mind” workshop is a full 2-day workshop not just to learn how NgRx works, but to learn the foundations of the framework, best practices, and how to think reactively when using NgRx. We will work through the NgRx architecture in-depth with practical examples for <a href="https://www.ng-conf.org/2019/sessions/ngrx-reactive-state-mind-day-1/">state management</a>, data models using <a href="https://www.ng-conf.org/2019/sessions/ngrx-reactive-state-mind-day-2/">selectors</a>, side effects, and testing. Whether you’re just starting with NgRx, or you’re already using it, there will be something for you at this workshop. Visit the <a href="https://ti.to/ng-conf/2019">registration page</a> to sign up.</p><p><strong>Thanks<br></strong>NgRx continues to be a community-driven project. Design, development, documentation, and testing all are done with the help of the community. We would like to thank the contributors to the latest version of NgRx including: kouMatsumoto, UncleJimmy, dummdidumm, kanafgan, tja4472, peterbsmith2, Guillaume de Jabrun, SerkanSipahi, cmckni3, patrickmcd, matepapp, alex-okrushko, rkirov, krzysztof-grzybek, xxluke, TeoTN, thefliik, icepeng, myspivey, wesleygrimes, null-reference, joostme, LukeHowellDev, baumandm, maxime1992, roopkt, bagbag, luchsamapparat, Fost, bcbanes, Teamop, seekheart, adrianfaciu, rafa-as, ngfelixl, sheikalthaf, itayod, karanveersp, and emilio-martinez. If you are interested in contributing, visit our <a href="https://github.com/ngrx/platform">GitHub</a> page and look through our open issues, some marked specifically for new contributors.</p><p>Along with the community, we cannot sustain NgRx without the help of our past and present backers and sponsors. Whether it be $2, $5, or more, our monthly backers have continued to support our efforts in developing and maintaining the platform. Our bronze level sponsors include <a href="https://oasisdigital.com/">Oasis Digital</a>, <a href="https://onehungrymind.com/">Lukas Ruebbelke</a>, <a href="https://blog.angularindepth.com/@alex.okrushko">Alex Okrushko</a>, along with a significant contribution from <a href="https://www.pluralsight.com/authors/deborah-kurata">Deborah Kurata</a>.</p><p>We would also like to give a big thanks to our silver sponsor, <a href="https://www.briebug.com/">BrieBug</a>. BrieBug is one of the top web and mobile application development consulting firms in the state of Colorado. BrieBug provides enterprise Angular consulting, architectural reviews, team training, and staff augmentation, with multiple Angular GDEs on staff. BrieBug was previously a bronze-level sponsor, but has since increased their sponsorship of NgRx development, providing further support for development, travel, and hosting expenses.</p><p>NgRx requires significant time and effort that often goes unpaid, and we would like to change that. If you or your company wants to contribute to NgRx as a backer or sponsor, please visit our <a href="https://opencollective.com/ngrx">OpenCollective</a> page for different contribution options or contact us directly for other sponsorship opportunities.</p><p>Follow us on <a href="https://medium.com/@ngrx">here</a> and on <a href="https://twitter.com/ngrx_io">Twitter</a> for the latest updates about the NgRx platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b43eee2795a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/announcing-ngrx-version-7-docs-testing-and-more-b43eee2795a4">Announcing NgRx Version 7 — Docs, Testing, and more</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing the Release of NgRx 6, New Projects, and Looking Ahead]]></title>
            <link>https://medium.com/ngrx/announcing-the-release-of-ngrx-6-new-projects-and-looking-ahead-5fc30bed260b?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/5fc30bed260b</guid>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Mike Ryan]]></dc:creator>
            <pubDate>Wed, 23 May 2018 13:14:38 GMT</pubDate>
            <atom:updated>2018-05-23T19:37:25.638Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we are excited to announce the official release of v6 of the NgRx framework. This release is jam packed with bug fixes and improvements to our Schematics package. We have focused on trying to make the upgrade as smooth as possible with very few breaking changes. You can view the <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">full change log</a> for a list of all of the bug fixes and breaking changes.</p><p>If you are using the CLI, upgrading is as easy as ng update @ngrx/store. This will update all of your NgRx packages to v6 including Effects, Schematics, Entity, Router Store, and Store Devtools.</p><h3>New Projects</h3><p>While there are very few user facing features in NgRx 6 this release was a major milestone for us. We have updated our build process to Bazel, we are committing to unifying our major version number with Angular, and we have strengthened our integration with the Angular CLI by introducing full support for theng add and ng update commands.</p><p>We have big plans for the near future of NgRx. This summer we will be working on NgRx.io, a brand new documentation resource for NgRx. Not only will this be the new home for our documentation and examples but we plan on launching an official NgRx style guide and collection of best practices to help teams be more productive with NgRx.</p><p>We have also begun planning out the NgRx 7 release. There is a milestone on the NgRx Platform repository that captures all of the new and exciting enhancements we are planning that <a href="https://github.com/ngrx/platform/projects/6">you can find here</a>. Highlights include better runtime development checks, builtin support for state hydration/serialization, improved type inference for Effects, and a variety of enhancements to NgRx Entity.</p><p>Also new in NgRx 7 will be the recently announced NgRx Data package by John Papa and Ward Bell. We are well aware that the explicitness that NgRx demands of developers causes slow development cycles and makes it hard to get started with NgRx quickly (“Boilerplate!”). John and Ward’s NgRx Data package simplifies the startup process by automatically integrating NgRx with your REST API; no actions, reducers, effects, or selectors required. Checkout the <a href="https://youtu.be/t3jx0EC-Y3c?t=34m42s">end of our ng-conf 2018 talk “Reducing the Boilerplate with NgRx”</a> to learn more about NgRx Data. We are excited to fold NgRx Data into the NgRx framework later this year.</p><h3>Looking Ahead</h3><p>NgRx.io, NgRx Data, and NgRx 7 gives you a roadmap of what to expect in the next six to nine months but what about beyond that? One of the biggest changes coming to Angular is the introduction of Renderer 3 — aka Ivy. Our friend Max at Angular in Depth <a href="https://blog.angularindepth.com/ivy-engine-in-angular-first-in-depth-look-at-compilation-runtime-and-change-detection-876751edd9fd">has a great write up of what’s changing</a> with this new renderer.</p><p>What excites the NgRx team about Ivy is that will enable us to introduce functional reactivity to even more parts of the Angular framework. NgRx has not always been just state management; some of our earlier packages provided reactive APIs for notifications, local storage, and routing. Over time we’ve deprecated some of these libraries and others — like NgRx Router — have been integrated directly into the Angular framework itself.</p><p>With Ivy we are excited to return to our roots and introduce more functional reactive libraries for Angular beyond state management. Expect us to start looking at introducing libraries for handling forms, routing, and components in the not-too-distant future.</p><h4>Not Going At This Alone</h4><p>The NgRx team is growing! We are excited to announce that <a href="https://twitter.com/wardbell">Ward Bell</a> and <a href="https://twitter.com/tim_deschryver">Tim Deschryver</a> are joining the NgRx team. Ward joins us to help build out and support NgRx Data as well as help us shape NgRx.io. Tim joins us to continue doing an excellent job supporting developers and building out the platform. Brandon, Rob, Victor, and myself will remain actively involved in planning, growing, and developing NgRx.</p><h4>NgRx at ng-conf 2018!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*OK3PCV7-j-dEj1da." /></figure><p>NgRx was provided a full fair-day track at ng-conf 2018, and we were very excited to see all the great talks and workshops. If you haven’t watched all the videos by the NgRx core team you can watch the <a href="https://www.youtube.com/playlist?list=PL8OUS498tQP3FFsZzULTGnbyIcILFjHd3">entire playlist</a> here.</p><p>We plan on attending even more events throughout 2018. You can find us at WeRise Tech, Framework Summit, and AngularConnect just to name a few. Head on over to the <a href="https://github.com/ngrx/platform">NgRx Platform repository</a> to find a full list of all the events and meet-ups that we will be attending. If you are at one of those events please come say hello and grab an NgRx sticker! We love engaging with developers that use NgRx .</p><h4>Thank You for Your Support</h4><p>This release was truly collaborative and we would like to take a minute to thank everyone who submitted pull requests and bug reports; you really helped shape this release. We would like to call out in particular Alex Eagle for his tremendous help in moving us to Bazel, Vitalii Bobrov for helping with Schematics integration and San Nguyen for the extra effort with issue triaging and pull requests.</p><p>We also greatly appreciate the continued support for NgRx from our backers and sponsors on OpenCollective. The support aids in the development time and effort put into the NgRx framework. If you haven’t already, consider backing or sponsoring NgRx <a href="https://opencollective.com/ngrx">through the OpenCollective</a>. We would also like to offer a huge shoutout and our gratitude to our trusted partners at Z Wave Development, BrieBug, Oasis Digital, and AngularFirebase along with Lukas Ruebbelke, Thomas Burleson, and Joshua Wiens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fc30bed260b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/announcing-the-release-of-ngrx-6-new-projects-and-looking-ahead-5fc30bed260b">Announcing the Release of NgRx 6, New Projects, and Looking Ahead</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NgRx 5 and Schematics]]></title>
            <link>https://medium.com/ngrx/ngrx-5-and-schematics-2d8cc3906506?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/2d8cc3906506</guid>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[rxjs]]></category>
            <dc:creator><![CDATA[Brandon Roberts]]></dc:creator>
            <pubDate>Tue, 13 Feb 2018 16:24:31 GMT</pubDate>
            <atom:updated>2018-02-15T13:30:48.506Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we are announcing the next major release of the NgRx platform of libraries. NgRx version 5 brings fixes, new features and a new library to the platform. While this may sound substantial, there are no substantial breaking changes in this release, other than removal of deprecated code in version 4 and bumping the minimum version of RxJS for pipeable operator support. This should make upgrading to the latest version fairly trivial.</p><h4>Breaking Changes</h4><p>The deprecatedtoPayload utility function in @ngrx/effects 4.1 was removed.</p><h4><strong>New Features</strong></h4><p><strong>Pipeable operators</strong></p><p>The release of RxJS 5.5 introduced support for pipeable operators, providing a better way to only use the operators you need. The Store and Effects libraries provide pipeable versions of the select and ofType operators respectively. The instance version of these operators are still available for backwards compatibility.</p><p><strong>Store</strong></p><pre>import { Store, select } from &#39;@ngrx/store&#39;;<br>import { Observable } from &#39;rxjs/Observable&#39;;<br><br>interface AppState {<br>  count: number;<br>}<br><br>@Component({<br>  selector: &#39;my-app&#39;,<br>  template: `<br>    &lt;button (click)=&quot;increment()&quot;&gt;Increment&lt;/button&gt;<br>    &lt;div&gt;Current Count: {{ count$ | async }}&lt;/div&gt;<br>    &lt;button (click)=&quot;decrement()&quot;&gt;Decrement&lt;/button&gt;<br><br>    &lt;button (click)=&quot;reset()&quot;&gt;Reset Counter&lt;/button&gt;<br>  `<br>})<br>export class MyAppComponent {<br>  count$: Observable&lt;number&gt;;<br><br>  constructor(private store: Store&lt;AppState&gt;) {<br>    this.count$ = store.pipe(select(&#39;count&#39;));<br>  }<br>}</pre><p><strong>Effects</strong></p><pre>import { Injectable } from &#39;@angular/core&#39;;<br>import { Actions, Effect, ofType } from &#39;@ngrx/effects&#39;;<br>import { map, tap } from &#39;rxjs/operators&#39;;<br><br>@Injectable()<br>export class AuthEffects {<br>  constructor(private actions$: Actions) {}<br><br>  @Effect() authActions$ = this.action$.pipe(<br>    ofType(&#39;LOGIN&#39;),<br>    tap(action =&gt; console.log(action)),<br>    map(() =&gt; ({ type: &#39;LOGGED_IN&#39; }))<br>  );<br>}</pre><p><strong>Integrated Error Handling</strong></p><p>Angular includes a built-in <a href="https://angular.io/api/core/ErrorHandler">Error Handler</a> for centralized error handling. Effects adds integration with this error handler, so instead of simply logging errors to the console, you can now integrate with your own custom error handling if your Effect throws an error.</p><p><strong>Store Devtools Improvements</strong></p><p>Store Devtools now includes optimizations when serializing state history, resulting in better overall performance. The <a href="https://medium.com/@zalmoxis/using-redux-devtools-in-production-4c5b56c5600f">Redux Devtools Extension</a> includes support for disabling extension features in production. Store Devtools now includes a logOnly option so you can include the Devtools in your production build, but only provide access to logging the state along with the powerful time-traveling debugging tools.</p><pre>import { StoreDevtoolsModule } from &#39;@ngrx/store-devtools&#39;;<br>import { environment } from &#39;../environments/environment&#39;;<br><br>@NgModule({<br>  imports: [<br>    StoreModule.forRoot(reducers),<br>    StoreDevtoolsModule.instrument({<br>      // Restrict extension to log-only mode<br>      logOnly: environment.production <br>    })<br>  ]<br>})<br>export class AppModule { }</pre><p>Store Devtools have also been updated with support for custom sanitizers for actions and state. This is especially useful if you include your devtools in production, but want to keep any sensitive information from dispatched actions or state. Now you can strip or modify actions and state before its displayed in the extension.</p><pre>import { StoreDevtoolsModule } from &#39;@ngrx/store-devtools&#39;;<br>import { environment } from &#39;../environments/environment&#39;;<br><br>@NgModule({<br>  imports: [<br>    StoreModule.forRoot(reducers),<br>    StoreDevtoolsModule.instrument({<br>      actionSanitizer: (action: Action, id: number) =&gt; {<br>        return { type: &#39;SANITIZED_ACTION&#39; };<br>      },<br>      stateSanitizer: (state: any, id: number) =&gt; {<br>        return &#39;SANITIZED_STATE&#39;;<br>      }<br>    })<br>  ]<br>})<br>export class AppModule { }</pre><p><strong>Entity</strong></p><p>Entity now includes new upsert adapter methods. The upsertOne and upsertMany methods insert new entities that aren’t currently present in the collection and update existing entities in the collection.</p><pre>import { EntityState, EntityAdapter, createEntityAdapter } from &#39;@ngrx/entity&#39;;<br>import { User } from &#39;./user.model&#39;;<br>import { UserActions, UserActionTypes } from &#39;./user.actions&#39;;</pre><pre>export interface State extends EntityState&lt;User&gt; {}</pre><pre>export const adapter: EntityAdapter&lt;User&gt; = createEntityAdapter&lt;User&gt;();</pre><pre>export const initialState: State = adapter.getInitialState();</pre><pre>export function reducer(<br>  state = initialState,<br>  action: UserActions<br>): State {<br>  case UserActionTypes.UPSERT_USER: {<br>    return adapter.upsertOne(action.payload.userUpdate, state);<br>  }</pre><pre>case UserActionTypes.UPSERT_USERS: {<br>    return adapter.upsertMany(action.payload.userUpdates, state);<br>  }</pre><pre>default:<br>    return state;<br>}</pre><h3><strong>Schematics</strong></h3><p>NgRx Schematics is an exciting addition to the NgRx platform. For a more general introduction to schematics, see the Angular <a href="https://blog.angular.io/schematics-an-introduction-dc1dfbc2a2b2">blog post</a>. Whether you’re already using NgRx in your application, or introducing it into an existing application, schematics allow you to quickly build out feature areas using NgRx with the Angular CLI.</p><p><strong>How to use</strong></p><p>Use the Angular CLI’s generate command to scaffold out NgRx blueprints.</p><p>You can add state management with @ngrx/store to your application with developer tools enabled.</p><pre>ng generate store State --root --module app.module.ts</pre><p>You can setup your application with @ngrx/effects:</p><pre>ng generate effect App --root --module app.module.ts</pre><p>You can also generate a feature set, including actions, a reducer and effects.</p><pre>ng generate feature User --module app.module.ts</pre><p>These are just a few examples of blueprints you can use when scaffolding out features that use NgRx libraries. You can visit our <a href="https://github.com/ngrx/platform">github repo</a> to find <a href="https://github.com/ngrx/platform/tree/master/docs/schematics">complete documentation</a> on using NgRx Schematics.</p><h4>Support NgRx</h4><p>With NgRx 4 we announced the creation of our <a href="https://opencollective.com/ngrx">OpenCollective</a> where you can help support the development of NgRx. We are thankful for the continued support from of our supporters and backers for the project. In addition to development efforts, we were also able to sponsor diversity tickets for <a href="https://medium.com/u/12ba64e34562">NgAtlanta</a>, which focused on diversity, inclusion and Angular. If you haven’t already, consider backing or sponsoring NgRx efforts <a href="https://opencollective.com/ngrx">through the OpenCollective</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d8cc3906506" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/ngrx-5-and-schematics-2d8cc3906506">NgRx 5 and Schematics</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing @ngrx/entity]]></title>
            <link>https://medium.com/ngrx/introducing-ngrx-entity-598176456e15?source=rss----5d62081307f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/598176456e15</guid>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <dc:creator><![CDATA[Mike Ryan]]></dc:creator>
            <pubDate>Thu, 19 Oct 2017 14:34:03 GMT</pubDate>
            <atom:updated>2017-10-19T14:34:03.305Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the most consistent complaints about building apps with NgRx is the amount of boilerplate developers have to write. The challenge when trying to solve the boilerplate issue is that the required explicitness is essential to get the full benefits out of the architecture. We think that by developing targeted libraries we can help reduce some of this boilerplate while retaining all of the benefits that NgRx provides.</p><p>Today we are excited to announce the release of @ngrx/entity, the first such library from the NgRx team designed to reduce boilerplate. Its goal is to help developers write reducer functions that maintain collections of entities.</p><h4>How it Works</h4><p>@ngrx/entity lets you create <em>entity adapters</em> for different kinds of entities. Using an entity adapter, you can quickly write reducer operations and automatically generate selectors. Pulling from our <a href="https://ngrx.github.io/platform/example-app">example application</a>, let’s say we want to write an application that manages a collection of books. The interface for books looks like this:</p><pre>interface Book {<br>  id: string;<br>  title: string;<br>}</pre><p>The first step to writing a reducer that manages this collection is to create an entity adapter:</p><pre>import { createEntityAdapter } from &#39;@ngrx/entity&#39;;</pre><pre>const bookAdapter = createEntityAdapter&lt;Book&gt;();</pre><p>Next we need to declare the interface for our books state:</p><pre>import { EntityState } from &#39;@ngrx/entity&#39;;</pre><pre>export interface BookState extends EntityState&lt;Book&gt; { }</pre><p>The shape of EntityState looks like this:</p><pre>interface EntityState&lt;V&gt; {<br>  ids: string[];<br>  entities: { [id: string]: V };<br>}</pre><p>There are two primary reasons we maintain a list of ids and a dictionary of entities:</p><ol><li>We want to make looking up a specific entity really fast. If you wanted to just select one book from the store, using the entities dictionary is much faster than searching through an array</li><li>We also want to maintain the order of the list. This is especially important if you want to keep the list sorted!</li></ol><p>The shape of EntityState&lt;V&gt; meets both goals. It’s also extendable, so we can include other pertinent information in the collection of Books, such as the currently selected book.</p><p>Next we define some actions:</p><pre>import { Action } from &#39;@ngrx/store&#39;;</pre><pre>export enum BookActionTypes {<br>  ADD_ONE = &#39;[Books] Add One&#39;,<br>  UPDATE_ONE = &#39;[Books] Update One&#39;,<br>  DELETE_ONE = &#39;[Books] Delete One&#39;,<br>  GET_ALL = &#39;[Books] Get All&#39;<br>}</pre><pre>export class AddOne implements Action {<br>  readonly type = BookActionTypes.ADD_ONE;</pre><pre>  constructor(public book: BookModel) { }<br>}</pre><pre>export class UpdateOne implements Action {<br>  readonly type = BookActionTypes.UPDATE_ONE;</pre><pre>  constructor(<br>    public id: string,<br>    public changes: Partial&lt;BookModel&gt;,<br>  ) { }<br>}</pre><pre>export class DeleteOne implements Action {<br>  readonly type = BookActionTypes.DELETE_ONE;</pre><pre>  constructor(public id: string) { }<br>}</pre><pre>export class GetAll implements Action {<br>  readonly type = BookActionTypes.GET_ALL;</pre><pre>  constructor(public books: BookModel[]) { }<br>}</pre><pre>export type BookActions<br>  = GetOne<br>  | UpdateOne<br>  | DeleteOne<br>  | GetAll;</pre><p>Now we are ready to use the bookAdapter to create our book reducer:</p><pre>const initialState: BookState = bookAdapter.getInitialState();</pre><pre>export function bookReducer(<br>  state: BookState = initialState,<br>  action: BookActions,<br>): BookState {<br>  switch (action.type) {<br>    case BookActionTypes.ADD_ONE:<br>      return bookAdapter.addOne(action.book, state);</pre><pre>    case BookActionTypes.UPDATE_ONE:<br>      return bookAdapter.updateOne({<br>        id: action.id,<br>        changes: action.changes,<br>      }, state);</pre><pre>    case BookActionTypes.DELETE_ONE:<br>      return bookAdapter.deleteOne(action.id, state);</pre><pre>    case BookActionTypes.GET_ALL:<br>      return bookAdapter.addAll(action.books, state);</pre><pre>    default:<br>      return state;<br>  }<br>}</pre><p>The new piece of state can be registered in the Store using the newly created reducer. The last thing we need to do is generate selectors for working with this state:</p><pre>export const {<br>  selectIds,<br>  selectEntities,<br>  selectAll,<br>  selectTotal,<br>} = bookAdapter.getSelectors();</pre><p>So what boilerplate did we save?</p><ol><li>No longer have to explicitly declare all of the properties for the state interface</li><li>The implementation for adding, deleting, or updating entities in the state are all handled by the adapter.</li><li>The adapter generates a set of commonly used selectors for you.</li></ol><p>More documentation about Entity is available in the <a href="https://github.com/ngrx/platform/tree/master/docs/entity">NgRx GitHub repo</a> and usage in the <a href="https://github.com/ngrx/platform/tree/master/example-app">example application</a>.</p><h4>NgRx 4.1 Released</h4><p>In addition to releasing @ngrx/entity, we have also published v4.1.0 of Store, Effects, and Router Store that includes a number of new features and bug fixes. For more information on what is included <a href="https://github.com/ngrx/platform/blob/master/CHANGELOG.md">please check the changelog</a>.</p><h4>Help Support NgRx</h4><p>With NgRx 4 we announced the creation of our <a href="https://opencollective.com/ngrx">OpenCollective</a> where you can help support the development of NgRx. We are very thankful for the support received from our backers, sponsors and community. Entity is the first the library created as a result of those contributions. Entity is the first step in creating more libraries for the NgRx platform. Consider supporting these development efforts <a href="https://opencollective.com/ngrx">through the OpenCollective</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=598176456e15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ngrx/introducing-ngrx-entity-598176456e15">Introducing @ngrx/entity</a> was originally published in <a href="https://medium.com/ngrx">@ngrx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>