Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. constructor(props) {
  2.  super(props);
  3.  if (!localStorage.getItem(‘appState’)) {
  4.  localStorage.setItem(‘appState’, JSON.stringify(initialState));
  5.  }
  6.  this.state = JSON.parse(localStorage.getItem(‘appState’));
  7.  this.editRecipeName = this.editRecipeName.bind(this);
  8.  this.setLocalStorage = this.setLocalStorage.bind(this);
  9.  this.deleteRecipe = this.deleteRecipe.bind(this);
  10.  this.addRecipe = this.addRecipe.bind(this);
  11.  }
  12.  setLocalStorage () {
  13.  localStorage.setItem(‘appState’, JSON.stringify(this.state));
  14.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement