jiti-meet/react/features/base/redux
zbettenbuk 158cadf4f9 Improve persistency layer 2018-02-02 15:13:26 -06:00
..
MiddlewareRegistry.js flow-typed 2017-02-03 16:36:14 -06:00
PersistencyRegistry.js Improve persistency layer 2018-02-02 15:13:26 -06:00
ReducerRegistry.js [flow] Take advantage of flow-typed 2017-02-03 16:36:14 -06:00
functions.js Improve persistency layer 2018-02-02 15:13:26 -06:00
index.js Improve persistency layer 2018-02-02 15:13:26 -06:00
middleware.js Improve persistency layer 2018-02-02 15:13:26 -06:00
readme.md Improve persistency layer 2018-02-02 15:13:26 -06:00

readme.md

Jitsi Meet - redux state persistency

Jitsi Meet has a persistency layer that persists a subtree (or specific subtrees) into window.localStorage (on web) or AsyncStorage (on mobile).

Usage

If a subtree of the redux store should be persisted (e.g. 'features/base/profile'), then persistency for that subtree should be requested by registering the subtree (and related config) into PersistencyRegistry.

E.g. to register the field profile of the Redux subtree 'features/base/profile' to be persisted, use:

PersistencyRegistry.register('features/base/profile', {
    profile: true
});

in the reducer.js of the profile feature.

When it's done, Jitsi Meet will automatically persist these subtrees/fields and rehidrate them on startup.

Throttling

To avoid too frequent write operations in the storage, we utilise throttling in the persistency layer, meaning that the storage gets persisted only once in every 2 seconds, even if multiple redux state changes occur during this period. This throttling timeout can be configured in

react/features/base/redux/middleware.js#PERSIST_DELAY