Skip to content

Instantly share code, notes, and snippets.

@bradfordlemley
Created May 29, 2019 22:17
Show Gist options
  • Save bradfordlemley/7d7f02a16c0bf9bf458c8d374e54e081 to your computer and use it in GitHub Desktop.
Save bradfordlemley/7d7f02a16c0bf9bf458c8d374e54e081 to your computer and use it in GitHub Desktop.
Simple mapState example
import { mapState } from '@stated-library/core';
const todoLib = createTodoLib();
const appState$ = mapState(
todoLib.state$,
state => ({
addTodo: todoLib.addTodo,
allTodos: state.todos,
isFetchingTodos: state.isFetching,
})
);
export {todoLib, appState$};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment