Skip to content

Instantly share code, notes, and snippets.

@webmasterdevlin
Created November 16, 2019 23:55
Show Gist options
  • Save webmasterdevlin/d139029de2beed0f2f472fe42119d462 to your computer and use it in GitHub Desktop.
Save webmasterdevlin/d139029de2beed0f2f472fe42119d462 to your computer and use it in GitHub Desktop.
createContextStore
import { action, computed, createContextStore, thunk } from 'easy-peasy'
import { deleteHero, getHeroById, getHeroes, postHero, putHero } from './hero-service'
const HeroStore = createContextStore({
/*states here*/
/*actions thunk side effects here*/
/*actions here*/
/*computed values i.e. derived state here*/
});
export default HeroStore;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment