You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 2.6.0 the API was modified to use the the configuration API, and it's now possible to emit values. However, it's not possible to define the event types inline. It should be possible to define it like this:
conststore=createStoreWithProducer(// Producerproduce,{//types is missing!types: {emitted: {}as{type: 'incremented';by: number},},context: {count: 0,todos: []},on: {inc: (context,event: {by: number})=>{// No return; handled by Immercontext.count+=event.by;},addTodo: (context,event: {todo: string})=>{// No return; handled by Immercontext.todos.push(event.todo);},},},);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In version 2.6.0 the API was modified to use the the configuration API, and it's now possible to emit values. However, it's not possible to define the event types inline. It should be possible to define it like this:
Beta Was this translation helpful? Give feedback.
All reactions