The code powering m.abunchtell.com https://m.abunchtell.com
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

25 líneas
644 B

  1. import { Iterable, fromJS } from 'immutable';
  2. import { hydrateCompose } from './compose';
  3. import { importFetchedAccounts } from './importer';
  4. export const STORE_HYDRATE = 'STORE_HYDRATE';
  5. export const STORE_HYDRATE_LAZY = 'STORE_HYDRATE_LAZY';
  6. const convertState = rawState =>
  7. fromJS(rawState, (k, v) =>
  8. Iterable.isIndexed(v) ? v.toList() : v.toMap());
  9. export function hydrateStore(rawState) {
  10. return dispatch => {
  11. const state = convertState(rawState);
  12. dispatch({
  13. type: STORE_HYDRATE,
  14. state,
  15. });
  16. dispatch(hydrateCompose());
  17. dispatch(importFetchedAccounts(Object.values(rawState.accounts)));
  18. };
  19. };