createSnapshot() {
      if (!_StateManager.isStorageAvailable()) {
        console.warn("localStorage is not available");
        return null;
      }
      const dataToSave = JSON.parse(JSON.stringify(this.store.getState()));
      const snapshot = {
        data: dataToSave,
        timestamp: Date.now()
      };
      this.emit("createSnapshot", snapshot);
      return snapshot;
    }
Restores the state from a snapshot.  
@param snapshot
@returns {*|null}