Skip to content
/ elf Public
forked from ngneat/elf

🧙‍♀️ A Reactive Store with Magical Powers

License

Notifications You must be signed in to change notification settings

IdanCo/elf

Repository files navigation

A Reactive State Management for JS Application (WIP)

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';
      })
    );
  }
}

About

🧙‍♀️ A Reactive Store with Magical Powers

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.2%
  • HTML 2.2%
  • SCSS 1.1%
  • Other 0.5%