Created
July 9, 2019 10:31
-
-
Save adamkleingit/8f0fe40f81bb408e54e13ea261e6b0f4 to your computer and use it in GitHub Desktop.
Reusable Selectors
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 'reusable'; | |
const useTodos = createStore(() => useState([])); | |
const Comp = () => { | |
const todosCount = useTodos( | |
([todos]) => todos.length | |
); | |
... | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment