aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux/store.ts
blob: fc943f1be137d93674da52cf612c51ca94e40127 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import * as _ from 'lodash';
import { createStore, Store as ReduxStore } from 'redux';

import { INITIAL_STATE, reducer, State } from './reducer';

export type Store = ReduxStore<State>;

export const store = {
    create: (withState: Partial<State>): Store => {
        const allInitialState = {
            INITIAL_STATE,
            ...withState,
        };
        return createStore(reducer, allInitialState);
    },
};