
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
mutableOnWithout the mutableOn function our entityReducer would look something like this.
const entityReducer = createReducer<{ entities: Record<number, { id: number; name: string }> }>(
{
entities: {},
},
on(create, (state, { type, ...entity }) => ({
...state,
entities: { ...state.entities, [entity.id]: entity }
}),
on(update, (state, { id, newName }) => {
const entity = state.entities[id]
if (entity) {
return {
...state,
entities: {
...state.entities,
[entity.id]: { ...entity, name: newName }
}
}
}
return state;
},
on(remove, (state, { id }) => {
const { [id]: removedEntity, ...rest } = state.entities;
return { ...state, entities: rest };
}),
)
With the mutableOn function we are able to directly perform state mutations in reducers with less noise, and more concise code.
const entityReducer = createReducer<{ entities: Record<number, { id: number; name: string }> }>(
{
entities: {},
},
mutableOn(create, (state, { type, ...entity }) => {
state.entities[entity.id] = entity
}),
mutableOn(update, (state, { id, newName }) => {
const entity = state.entities[id]
if (entity) {
entity.name = newName
}
}),
mutableOn(remove, (state, { id }) => {
delete state.entities[id]
}),
)
mutableReducerFor when you want to go all-in!
Does work with the NgRx on method, as well as the mutableOn method.
The only difference is that it's needed to return the state with the on method.
const entityReducer = createMutableReducer<{ entities: Record<number, { id: number; name: string }> }>(
{
entities: {},
},
on(create, (state, { type, ...entity }) => {
state.entities[entity.id] = entity
// explicit return state with `on`
return state
}),
on(update, (state, { id, newName }) => {
const entity = state.entities[id]
if (entity) {
entity.name = newName
}
// explicit return state with `on`
return state
}),
mutableOn(remove, (state, { id }) => {
delete state.entities[id]
// don't have to return state with `mutableOn`
}),
)
Thanks goes to these wonderful people (emoji key):
Tim Deschryver 💻 ⚠️ | Maarten Tibau 📖 | xiansheng lu 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Utilities for NgRx
We found that ngrx-etc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.