Skip to content

ngneat/elf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5651be0 Β· Jul 21, 2024
Sep 15, 2023
Sep 10, 2021
Apr 11, 2021
Dec 23, 2023
Jul 21, 2024
Apr 16, 2024
Aug 12, 2023
Sep 30, 2021
Apr 4, 2021
Aug 12, 2023
Aug 12, 2023
Nov 17, 2023
Sep 30, 2021
Nov 17, 2023
Apr 4, 2021
Sep 10, 2021
Jun 11, 2022
Sep 12, 2021
Feb 10, 2024
Sep 10, 2021
Oct 31, 2022
Jan 1, 2022
Aug 25, 2021
Aug 12, 2023
Aug 12, 2023
Feb 1, 2024
Feb 1, 2024
Feb 1, 2024
Feb 1, 2024
Oct 10, 2021

Repository files navigation

Elf

A Reactive Store with Magical Powers

Elf is a reactive immutable state management solution built on top of RxJS. It uses custom RxJS operators to query the state and pure functions to update it.

Elf encourages simplicity. It saves you the hassle of creating boilerplate code and offers powerful tools with a moderate learning curve, suitable for experienced and inexperienced developers alike.

βœ…  Modular by design
βœ…  Tree Shakeable & Fully Typed
βœ…  CLI
βœ…  First Class Entities Support
βœ…  Requests Status & Cache
βœ…  Persist State
βœ…  State History
βœ…  Pagination
βœ…  Devtools

Sponsoring ngneat

Sponsorships aid in the continued development and maintenance of ngneat libraries. Consider asking your company to sponsor ngneat as its core to their business and application development.

Gold Sponsors

Elevate your support by becoming a Gold Sponsor and have your logo prominently featured on our README in the top 5 repositories.

Silver Sponsors

Boost your backing by becoming a Gold Sponsor and enjoy the spotlight with your logo prominently showcased in the top 3 repositories on our README.

Bronze Sponsors

House of Angular

Become a bronze sponsor and get your logo on our README on GitHub.


@ngneat/elf commitizen PRs coc-badge semantic-release styled with prettier

πŸ€“ Learn about it on the docs site

πŸ‘©β€πŸŽ“ Check out the React Todos example

πŸ˜‹ Check out the Angular Todos example or Books example


import { createStore, withProps, select, setProp } from '@ngneat/elf';
import { withEntities, selectAllEntities, setEntities } from '@ngneat/elf-entities';

interface TodosProps {
  filter: 'ALL' | 'ACTIVE' | 'COMPLETED';
}

interface Todo {
  id: string;
  title: string;
  status: string;
}

const store = createStore({ name: 'todos' }, withProps<TodosProps>({ filter: 'ALL' }), withEntities<Todo>());

export const filter$ = store.pipe(select(({ filter }) => filter));
export const todos$ = store.pipe(selectAllEntities());

export function setTodos(todos: Todo[]) {
  store.update(setEntities(todos));
}

export function updateFilter(filter: TodosProps['filter']) {
  store.update(setProp('filter', filter));
}

πŸ—’οΈ Review the Change Logs

⭐ Usage Trend of Elf Packages

Usage Trend of Elf Packages