2018-07-05 03:14:40 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { registerStore } from '@wordpress/data';
|
|
|
|
import { combineReducers } from 'redux';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { applyMiddleware, addThunks } from './middleware';
|
|
|
|
import orders from 'store/orders';
|
2018-08-28 18:43:26 +00:00
|
|
|
import products from 'store/products';
|
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-28 18:43:26 +00:00
|
|
|
products: products.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-28 18:43:26 +00:00
|
|
|
...products.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-28 18:43:26 +00:00
|
|
|
...products.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-28 18:43:26 +00:00
|
|
|
...products.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 ] );
|