import{App}from'reapex'importimmerfrom'reapex-plugin-immer'constapp=newApp()// 1. register the pluginapp.plugin(immer)// 2. in mutations, we can expect the state it receives as an immer draft objectinterfaceTodoState{todos: string[]}constinitial: TodoState={todos: [],}constTodoModel=app.model('todos',initial)const[mutations]=TodoModel.mutations({add: (todo: string)=>state=>{// the state here is an immer draftstate.todos.push(todo)returnstate},})
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.