Hello everyone, my name is Maxim Ivanov. I am a member of the NGXS team and the organizer NGXS-Labs. I’ve been with the team for 2 years and I’ve learned a lot. All this time I’ve been searching for new approaches for state management.
In Angular applications, basically everyone uses NGRX. However, I’d like to share my experience back when we had a medium-large enterprise application. We started with NGRX, but it quickly became clear that:
Hello everyone, my name is Maxim Ivanov. I am a member of the NGXS team and organizer NGXS-Labs. I have been with the team for 2 years and over the years I have learned a lot. Last time we talked about what does NGXS offer for us. Today, we will go back in time and find out how it all began.
If you want to conveniently debug your application in a development mode, or make a Chrome extension, you can do this:
The Angular team has worked hard to ensure Ivy is as backwards-compatible with the previous rendering engine (“View Engine”) as possible. Unfortunately, some changes have to be made so that NGXS and Ivy can function together seamlessly.
Angular provides the ability to have a different environment file loaded for development as compared to production or other build targets. We can use this to improve our application bundling when it comes to development only packages. In NGXS the packages that are mainly useful only for development mode are the
@ngxs/logger-plugin. Typically you would only want to use these packages during development and not in production.
Let’s look at the code below:
The behavior of the memoised selectors can be configured at a global level using the
selectorOptions property in the options passed to the
NgxsModule.forRoot call (see Options). These options can also be provided through the
@SelectorOptions decorator at a Class or Method level in order to configure the behavior of selectors within that scope. The following options are available:
truewill cause any error within a selector to result in the selector returning
falseresults in these errors propagating through the stack that triggered the evaluation of the selector that caused the error.
NOTE: The default for this setting…
Last time we talked about how to work with immutable data and how to store data in NGXS (part I, part II, part III). Today we will talk about what does NGXS offer and when need to choose native RxJS. In the following parts, we will discuss many interesting topics related to NGXS. But before diving in, let’s look at the history of state management and where NGXS came from.
Next time we talk about:
Part II. Is Flux the foundation of our architecture? Part…
Hello everyone, my name is Maxim Ivanov. I am a member of the NGXS team. Last time we talked about how to create immutable objects to avoid mutation. Today we will get acquainted with the built-in tools in NGXS to prevent mutations.
Hello everyone, my name is Maxim Ivanov. I am a member of the NGXS team. In the previous article we looked at how we can prevent object mutations. Now we will look at how you can avoid mutations by creating immutable objects and making ‘changes’ to them in an immutable way.