https://github.com/faustienf/effector-fsp
☄️ Effector FSP. Filter→Sort→Paginate
https://github.com/faustienf/effector-fsp
effector effector-react
Last synced: about 1 month ago
JSON representation
☄️ Effector FSP. Filter→Sort→Paginate
- Host: GitHub
- URL: https://github.com/faustienf/effector-fsp
- Owner: faustienf
- License: mit
- Created: 2022-07-14T18:01:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-17T21:51:12.000Z (almost 3 years ago)
- Last Synced: 2023-04-27T15:53:12.361Z (almost 2 years ago)
- Topics: effector, effector-react
- Language: TypeScript
- Homepage: https://codesandbox.io/s/github/faustienf/effector-fsp
- Size: 717 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# ☄️ Effector FSP
```mermaid
flowchart LR
subgraph Combine
direction LR
Filter --> Sort
Sort --> Paginate
end
Data -.-> Combine
Combine -.-> FSP
``````ts
const $todos = createStore([]);
```#### Filter
```ts
const filters = createFilters($todos, (todo, field, value) =>
String(todo[field]).toLowerCase().includes(value.toLowerCase())
);
```#### Sort
```ts
const sorting = createSorting({
$allRecords: filters.$filtredRecords,
comparator: todoComparator,
initialField: 'id' as keyof Todo,
initialOrder: 'desc',
});
```#### Paginate
```ts
const pagination = createPagination(sorting.$sortedRecords, 10);
```