2018-07-05 03:14:40 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2018-11-02 19:37:28 +00:00
|
|
|
import { combineReducers, registerStore } from '@wordpress/data';
|
2018-07-05 03:14:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { applyMiddleware, addThunks } from './middleware';
|
|
|
|
import orders from 'store/orders';
|
2018-08-15 13:44:49 +00:00
|
|
|
import reports from 'store/reports';
|
2018-10-12 19:20:48 +00:00
|
|
|
import notes from 'store/notes';
|
2018-07-05 03:14:40 +00:00
|
|
|
|
|
|
|
const store = registerStore( 'wc-admin', {
|
|
|
|
reducer: combineReducers( {
|
|
|
|
orders: orders.reducer,
|
2018-08-15 13:44:49 +00:00
|
|
|
reports: reports.reducer,
|
2018-10-12 19:20:48 +00:00
|
|
|
notes: notes.reducer,
|
2018-07-05 03:14:40 +00:00
|
|
|
} ),
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
...orders.actions,
|
2018-08-15 13:44:49 +00:00
|
|
|
...reports.actions,
|
2018-10-12 19:20:48 +00:00
|
|
|
...notes.actions,
|
2018-07-05 03:14:40 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
selectors: {
|
|
|
|
...orders.selectors,
|
2018-08-15 13:44:49 +00:00
|
|
|
...reports.selectors,
|
2018-10-12 19:20:48 +00:00
|
|
|
...notes.selectors,
|
2018-07-05 03:14:40 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
resolvers: {
|
|
|
|
...orders.resolvers,
|
2018-08-15 13:44:49 +00:00
|
|
|
...reports.resolvers,
|
2018-10-12 19:20:48 +00:00
|
|
|
...notes.resolvers,
|
2018-07-05 03:14:40 +00:00
|
|
|
},
|
|
|
|
} );
|
|
|
|
|
|
|
|
applyMiddleware( store, [ addThunks ] );
|