Last active
November 16, 2019 23:42
-
-
Save webmasterdevlin/e8c14465a25d434f4d220facdb1a2357 to your computer and use it in GitHub Desktop.
Easy Peasy State
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 { 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