Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngneat/elf
🧙♀️ A Reactive Store with Magical Powers
https://github.com/ngneat/elf
angular javascript react rxjs state-management
Last synced: 3 days ago
JSON representation
🧙♀️ A Reactive Store with Magical Powers
- Host: GitHub
- URL: https://github.com/ngneat/elf
- Owner: ngneat
- License: mit
- Created: 2021-06-18T07:33:16.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-21T06:23:58.000Z (5 months ago)
- Last Synced: 2024-10-29T14:56:29.301Z (about 1 month ago)
- Topics: angular, javascript, react, rxjs, state-management
- Language: TypeScript
- Homepage: https://ngneat.github.io/elf/
- Size: 9.71 MB
- Stars: 1,616
- Watchers: 25
- Forks: 94
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.config.js
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-opensource-israel - @ngneat/elf - 🧙♀️ A Reactive Store with Magical Powers ![GitHub last commit](https://img.shields.io/github/last-commit/ngneat/elf?style=flat-square) ![GitHub top language](https://img.shields.io/github/languages/top/ngneat/elf?style=flat-square) ![GitHub stars](https://img.shields.io/github/stars/ngneat/elf?style=flat-square) (Projects by main language / angular)
- awesome-angular - elf - 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. (Table of contents / Third Party Components)
- fucking-awesome-angular - elf - 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. (Table of contents / Third Party Components)
- fucking-awesome-angular - elf - 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. (Table of contents / Third Party Components)
- fucking-awesome-angular - elf - 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. (Table of contents / Third Party Components)
README
# 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](https://github.com/sponsors/ngneat) 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
Become a bronze sponsor and get your logo on our README on GitHub.
[![@ngneat/elf](https://github.com/ngneat/elf/actions/workflows/ci.yml/badge.svg)](https://github.com/ngneat/elf/actions/workflows/ci.yml)
[![commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)]()
[![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)]()
[![coc-badge](https://img.shields.io/badge/codeof-conduct-ff69b4.svg?style=flat-square)]()
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e5079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)## 🤓 Learn about it on the [docs site](https://ngneat.github.io/elf/)
## 👩🎓 Check out the React Todos [example](https://stackblitz.com/edit/react-ts-jidhej?file=todos/todos.tsx)
## 😋 Check out the Angular Todos [example](https://stackblitz.com/edit/angular-ivy-sky1gb?file=src/app/todos/state/todos.repository.ts) or Books [example](https://stackblitz.com/edit/angular-ivy-j9azue?file=src/app/state/books.repository.ts)
```ts
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({ filter: 'ALL' }), withEntities());
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
- [`@ngneat/elf`](https://github.com/ngneat/elf/blob/master/packages/store/CHANGELOG.md)
- [`@ngneat/elf-cli`](https://github.com/ngneat/elf/blob/master/packages/cli/CHANGELOG.md)
- [`@ngneat/elf-devtools`](https://github.com/ngneat/elf/blob/master/packages/devtools/CHANGELOG.md)
- [`@ngneat/elf-entities`](https://github.com/ngneat/elf/blob/master/packages/entities/CHANGELOG.md)
- [`@ngneat/pagination`](https://github.com/ngneat/elf/blob/master/packages/pagination/CHANGELOG.md)
- [`@ngneat/persist-state`](https://github.com/ngneat/elf/blob/master/packages/persist-state/CHANGELOG.md)
- [`@ngneat/requests`](https://github.com/ngneat/elf/blob/master/packages/requests/CHANGELOG.md)
- [`@ngneat/state-history`](https://github.com/ngneat/elf/blob/master/packages/state-history/CHANGELOG.md)## ⭐ Usage Trend of Elf Packages
[Usage Trend of Elf Packages](https://npm-compare.com/@ngneat/elf,@ngneat/elf-entities,@ngneat/elf-devtools,@ngneat/elf-persist-state,@ngneat/elf-requests,@ngneat/elf-pagination,@ngneat/elf-cli-ng,@ngneat/elf-state-history,@ngneat/elf-cli)