GitHub package.json versionTypeScriptNPM
GitHub package.json versionTypeScriptNPM

Storage

About the Storage

The Eagle Eye context allows for a user-defined Storage object to be provided for maintaining the integrity of the initial context state at a location of the user's choosing.

This, it accepts, via its Provider's storage optional prop.

The context defaults to window.sessionstorage in supporting environments. Otherwise, it defaults to its own internal memory-based storage.

A valid storage object is of the type: IStorage<State> implementing the following 4 methods:

  1. clone: (data: State) => State; // expects a state clone
  2. getItem: (key: string) => State;
  3. removeItem: (key: string) => void;
  4. setItem: (key: string, data: State) => void;