Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constructor(props) {
- super(props);
- if (!localStorage.getItem(‘appState’)) {
- localStorage.setItem(‘appState’, JSON.stringify(initialState));
- }
- this.state = JSON.parse(localStorage.getItem(‘appState’));
- this.editRecipeName = this.editRecipeName.bind(this);
- this.setLocalStorage = this.setLocalStorage.bind(this);
- this.deleteRecipe = this.deleteRecipe.bind(this);
- this.addRecipe = this.addRecipe.bind(this);
- }
- setLocalStorage () {
- localStorage.setItem(‘appState’, JSON.stringify(this.state));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement