Comments (1)
v2.x
@State<AnimalsStateModel>({
name: 'animals',
defaults: {
zebra: {
food: [],
name: 'zebra'
},
panda: {
food: [],
name: 'panda'
}
}
})
export class AnimalState {
@Mutation()
@Action(FeedZebra)
public feedZebra(ctx: StateContext<AnimalsStateModel>, { payload }: FeedZebra): AnimalsStateModel {
ctx.setState((state: AnimalsStateModel) => { // immutable mutation with immer (analogue produce)
state.zebra.food.push(payload);
return state;
})
}
}
from immer-adapter.
Related Issues (20)
- Support Immer 2.0
- Is the documentation example incorrect? HOT 1
- Error: TypeError: 'ownKeys' on proxy: trap result did not include 'scope' HOT 18
- Error: Cannot read property 'ctx' of undefined HOT 4
- immer 3.0.0 compatible? HOT 1
- @ImmutableContext() doesn't work with Receiver() properly HOT 9
- Can't reset state returning 'defaults' or an object with the type of the state HOT 3
- When state is null/undefined ImmutableSelector/ImmutableContext stops working. HOT 11
- Calling isDevMode() breaks production builds HOT 1
- not working with dynamic selector HOT 3
- Immer patches and inverse patches
- Documentation typo? HOT 2
- Updating Reactive Form in State HOT 2
- getState within @ImmutableContext() returns a draft HOT 4
- Peer Dependency Support for angular v9 & v10 HOT 1
- dispatch in state
- Release for security patch HOT 1
- Angular 12 HOT 9
- Do we still need immer and this adapter when we have State Operators? HOT 2
- Project won't update on npm?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immer-adapter.