An open API service indexing awesome lists of open source software.

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

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);
```