Skip to content

Instantly share code, notes, and snippets.

@webmasterdevlin
Last active November 16, 2019 23:42
Show Gist options
  • Save webmasterdevlin/e8c14465a25d434f4d220facdb1a2357 to your computer and use it in GitHub Desktop.
Save webmasterdevlin/e8c14465a25d434f4d220facdb1a2357 to your computer and use it in GitHub Desktop.
Easy Peasy State
import { action, computed, createContextStore, thunk } from 'easy-peasy'
import { deleteHero, getHeroById, getHeroes, postHero, putHero } from './hero-service'
const HeroStore = createContextStore({
/*states*/
heroes: [],
hero: {
id: "",
firstName: "",
lastName: "",
house: "",
knownAs: ""
},
error: "",
isLoading: false
});
export default HeroStore;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment