Gathering detailed insights and metrics for ngrx-immer
Gathering detailed insights and metrics for ngrx-immer
Gathering detailed insights and metrics for ngrx-immer
Gathering detailed insights and metrics for ngrx-immer
ngrx-wieder
Lightweight undo-redo for NgRx
@spaf/ngrx-orchestrator
A Powerful State Management Toolkit for Angular
@ng-state/store
RxJS and Immer (or ImmutableJs) powered nested state management for Angular2 apps inspired by @ngrx.
small-store
A small, immutable, reactive and framework agnostic state store under 2KB powered by rxjs and immer with native typescript support. To be used with vanilla, react, preact, angular, vue or whatever you like.
Immer wrappers around NgRx methods createReducer, on, and ComponentStore
npm install ngrx-immer
Typescript
Module System
Node Version
NPM Version
TypeScript (97.08%)
JavaScript (2.92%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
123 Stars
34 Commits
7 Forks
1 Watchers
3 Branches
5 Contributors
Updated on May 17, 2025
Latest Version
3.0.0
Package Id
ngrx-immer@3.0.0
Unpacked Size
39.86 kB
Size
11.68 kB
File Count
33
NPM Version
10.8.2
Node Version
20.15.1
Published on
Jul 26, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
Immer wrappers around NgRx methods to simplify mutating state
1npm install ngrx-immer
Do not forget to install immer
createImmerReducer
(@ngrx/store)Creates an NgRx reducer, but allows you to mutate state without having to use to spread operator.
on
method1import { createImmerReducer } from 'ngrx-immer/store'; 2 3const todoReducer = createImmerReducer( 4 { todos: [] }, 5 on(newTodo, (state, action) => { 6 state.todos.push({ text: action.todo, completed: false }); 7 return state; 8 }), 9 on(completeTodo, (state, action) => { 10 state.todos[action.index].completed = true; 11 return state; 12 }), 13);
immerOn
(@ngrx/store)Creates an NgRx reducer, but allows you to mutate state without having to use to spread operator.
1import { immerOn } from 'ngrx-immer/store'; 2 3const todoReducer = createReducer( 4 { todos: [] }, 5 on(newTodo, (state, action) => { 6 return { 7 ...state, 8 todos: [...state.todos, action.todo], 9 }; 10 }), 11 immerOn(completeTodo, (state, action) => { 12 state.todos[action.index].completed = true; 13 }), 14);
ImmerComponentStore
(@ngrx/component-store)Wraps Immer around the Component Store updater
and setState
methods.
1import { ImmerComponentStore } from 'ngrx-immer/component-store'; 2 3@Injectable() 4export class MoviesStore extends ImmerComponentStore<MoviesState> { 5 constructor() { 6 super({ movies: [] }); 7 } 8 9 readonly addMovie = this.updater((state, movie: Movie) => { 10 state.movies.push(movie); 11 }); 12}
immerPatchState
(@ngrx/signals)[!IMPORTANT]
Because@ngrx/signals
is in developer preview, theimmerPatchState
function is also in developer preview. It is ready to try, but may change before becoming stable.
Provides an Immer-version of the patchState
function from the @ngrx/signals
package. In addition to partial state objects and updaters that update the state immutably, it accepts updater functions that update the state in a mutable manner. Similar to patchState
, the immerPatchState
function can be used to update the state of both SignalStore and SignalState.
1const UserStore = signalStore( 2 withState({ 3 user: { firstName: 'Konrad', lastName: 'Schultz' }, 4 address: { city: 'Vienna', zip: '1010' }, 5 }), 6 withMethods((store) => ({ 7 setLastName(lastName: string): void { 8 immerPatchState(store, (state) => { 9 state.user.lastName = lastName; 10 }); 11 }, 12 setCity(city: string): void { 13 immerPatchState(store, (state) => { 14 state.address.city = city; 15 }); 16 }, 17 })) 18);
Please note, that the updater function can only mutate a change without returning it or return an immutable state without mutable change.
This one is going to throw a runtime error:
1// will throw because of both returning and mutable change 2immerPatchState(userStore, (state) => { 3 state.name.lastname = 'Sanders'; // mutable change 4 return state; // returning state 5});
immerReducer
Inspired by Alex Okrushko, immerReducer
is a reducer method that uses the Immer produce
method.
This method is used by all the methods in ngrx-immer
provides.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More