restoreSnapshot(snapshot) {
      if (!_StateManager.isStorageAvailable()) {
        console.warn("localStorage is not available");
        return null;
      }
      if (snapshot) {
        Object.assign(this.store.state, snapshot.data);
        this.emit("restoreSnapshot", snapshot);
        return snapshot;
      }
      return null;
    }
Enables automatic state-saving at a specified interval.
@param interval