Created
March 27, 2020 20:57
-
-
Save mattbajorek/4aa160fb17370ead5dc03b2acc5f4e4a to your computer and use it in GitHub Desktop.
todos-redux-to-react-sweet-state visibile todo list container
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 React from 'react' | |
import TodoList from '../components/TodoList' | |
import multiStoreSelectors from '../stores/multi-store.selectors' | |
const VisibleTodoList = ({ children }) => { | |
const [visibleTodos, { toggleTodo }] = multiStoreSelectors.useVisibleTodos() | |
return ( | |
<TodoList | |
todos={visibleTodos} | |
toggleTodo={toggleTodo}> | |
{children} | |
</TodoList> | |
) | |
} | |
export default VisibleTodoList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment