Last active
May 8, 2022 04:04
-
-
Save Kelin2025/ba10d20e9b6351959b70899e5ccd6b12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore } from 'effector' | |
// Simple stores | |
const $todo = createStore('') | |
const $todos = createStore([]) | |
// Use store.map(state => computedState) | |
// To create computed stores | |
const $todosCount = $todos.map(todos => todos.length) | |
const $completedTodos = $todos.map(todos => todos.filter(todo => todo.completed)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment