[Glitch] Implement tag auto-completion by history

Port 460e380d38 to glitch-soc
This commit is contained in:
Thibaut Girka
2018-08-28 13:52:18 +02:00
committed by ThibG
parent e3246cd13b
commit 24b6811a6e
6 changed files with 135 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
import { Iterable, fromJS } from 'immutable';
import { hydrateCompose } from './compose';
export const STORE_HYDRATE = 'STORE_HYDRATE';
export const STORE_HYDRATE_LAZY = 'STORE_HYDRATE_LAZY';
@@ -8,10 +9,14 @@ const convertState = rawState =>
Iterable.isIndexed(v) ? v.toList() : v.toMap());
export function hydrateStore(rawState) {
const state = convertState(rawState);
return dispatch => {
const state = convertState(rawState);
return {
type: STORE_HYDRATE,
state,
dispatch({
type: STORE_HYDRATE,
state,
});
dispatch(hydrateCompose());
};
};