woocommerce/plugins/woocommerce-admin/client/store/index.js

52 lines
1.0 KiB
JavaScript
Raw Normal View History

/** @format */
/**
* External dependencies
*/
import { combineReducers, registerStore } from '@wordpress/data';
/**
* Internal dependencies
*/
import { applyMiddleware, addThunks } from './middleware';
import coupons from 'store/coupons';
import orders from 'store/orders';
import products from 'store/products';
import reports from 'store/reports';
2018-10-12 19:20:48 +00:00
import notes from 'store/notes';
const store = registerStore( 'wc-admin', {
reducer: combineReducers( {
coupons: coupons.reducer,
orders: orders.reducer,
products: products.reducer,
reports: reports.reducer,
2018-10-12 19:20:48 +00:00
notes: notes.reducer,
} ),
actions: {
...coupons.actions,
...orders.actions,
...products.actions,
...reports.actions,
2018-10-12 19:20:48 +00:00
...notes.actions,
},
selectors: {
...coupons.selectors,
...orders.selectors,
...products.selectors,
...reports.selectors,
2018-10-12 19:20:48 +00:00
...notes.selectors,
},
resolvers: {
...coupons.resolvers,
...orders.resolvers,
...products.resolvers,
...reports.resolvers,
2018-10-12 19:20:48 +00:00
...notes.resolvers,
},
} );
applyMiddleware( store, [ addThunks ] );