jiti-meet/react/features/base/storage
Lyubo Marinov d727ee80b2 [RN] Fix base/profile and recent-list bugs 2018-02-27 20:52:34 -06:00
..
native [RN] Protect AbstractApp and localStorage initialization 2018-02-05 15:26:01 -06:00
PersistenceRegistry.js [RN] Fix base/profile and recent-list bugs 2018-02-27 20:52:34 -06:00
README.md Introduce base/storage to represent the Web Storage API and persistence-related customizations 2018-02-02 15:13:26 -06:00
_.native.js Introduce base/storage to represent the Web Storage API and persistence-related customizations 2018-02-02 15:13:26 -06:00
_.web.js Introduce base/storage to represent the Web Storage API and persistence-related customizations 2018-02-02 15:13:26 -06:00
index.js Introduce base/storage to represent the Web Storage API and persistence-related customizations 2018-02-02 15:13:26 -06:00
middleware.js Introduce base/storage to represent the Web Storage API and persistence-related customizations 2018-02-02 15:13:26 -06:00

README.md

Jitsi Meet - redux state persistence

Jitsi Meet has a persistence layer that persists specific subtrees of the redux store/state 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 persistence for that subtree should be requested by registering the subtree with PersistenceRegistry.

For example, to register the field profile of the redux subtree 'features/base/profile' to be persisted, use:

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

in the reducer.js of the base/profile feature.

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

Throttling

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

react/features/base/storage/middleware.js#PERSIST_STATE_DELAY