const { state, config } = createState(
withEntities<Todo>(),
withUIEntities<UIEntity>(),
withProps<{ foo: string }>({ foo: '' })
);
const store = new Store({ state, name: 'todos', config });
class TodosRepositry {
todos$ = store.pipe(selectAll());
todo$ = (id) => store.pipe(selectEntity(id));
addTodo() {
store.reduce(
addEntity({ id: 1, title: '' }),
write((state) => {
state.foo = 'newfoo';
})
);
}
}
forked from ngneat/elf
-
Notifications
You must be signed in to change notification settings - Fork 0
🧙♀️ A Reactive Store with Magical Powers
License
IdanCo/elf
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
🧙♀️ A Reactive Store with Magical Powers
Resources
License
Code of conduct
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- TypeScript 96.2%
- HTML 2.2%
- SCSS 1.1%
- Other 0.5%