GitHub package.json versionTypeScriptNPM
GitHub package.json versionTypeScriptNPM
Latest

Storage

About the Storage

The React Eagle Eye 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, either via its createEagleEye(...) optional third parameter or by setting its prehooks property.

The React Eagle Eye 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;