Commiting

This commit is contained in:
mgabdev
2020-11-15 12:48:32 -06:00
parent 62515bbaee
commit fb612f60c8
1011 changed files with 3507 additions and 49604 deletions

View File

@@ -1,24 +1,22 @@
import { Iterable, fromJS } from 'immutable';
import { hydrateCompose } from './compose';
import { importFetchedAccounts } from './importer';
import { Iterable, fromJS } from 'immutable'
import { hydrateCompose } from './compose'
import { importFetchedAccounts } from './importer'
export const STORE_HYDRATE = 'STORE_HYDRATE';
export const STORE_HYDRATE_LAZY = 'STORE_HYDRATE_LAZY';
export const STORE_HYDRATE = 'STORE_HYDRATE'
export const STORE_HYDRATE_LAZY = 'STORE_HYDRATE_LAZY'
const convertState = rawState =>
fromJS(rawState, (k, v) =>
Iterable.isIndexed(v) ? v.toList() : v.toMap());
const convertState = (rawState) => {
return fromJS(rawState, (k, v) => Iterable.isIndexed(v) ? v.toList() : v.toMap())
}
export function hydrateStore(rawState) {
return (dispatch) => {
const state = convertState(rawState);
export const hydrateStore = (rawState) => (dispatch) => {
const state = convertState(rawState)
dispatch({
type: STORE_HYDRATE,
state,
});
dispatch({
type: STORE_HYDRATE,
state,
})
dispatch(hydrateCompose());
if (rawState.accounts) dispatch(importFetchedAccounts(Object.values(rawState.accounts)));
};
};
dispatch(hydrateCompose())
if (rawState.accounts) dispatch(importFetchedAccounts(Object.values(rawState.accounts)))
}