]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/actions/store.js
Change IDs to strings rather than numbers in API JSON output (#5019)
[mastodon.git] / app / javascript / mastodon / actions / store.js
1 import { Iterable, fromJS } from 'immutable';
2
3 export const STORE_HYDRATE = 'STORE_HYDRATE';
4 export const STORE_HYDRATE_LAZY = 'STORE_HYDRATE_LAZY';
5
6 const convertState = rawState =>
7 fromJS(rawState, (k, v) =>
8 Iterable.isIndexed(v) ? v.toList() : v.toMap());
9
10 export function hydrateStore(rawState) {
11 const state = convertState(rawState);
12
13 return {
14 type: STORE_HYDRATE,
15 state,
16 };
17 };
This page took 0.074999 seconds and 5 git commands to generate.