Implement tag auto-completion by history (#6621)

This is a functionality similar to one implemented in Pawoo:
21a3c70f80
This commit is contained in:
Akihiko Odaki
2018-03-05 04:27:25 +09:00
committed by Eugen Rochko
parent 778b37790b
commit 460e380d38
5 changed files with 95 additions and 7 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());
};
};