Skip to content

Instantly share code, notes, and snippets.

@aduth
Created February 22, 2018 18:52
Show Gist options
  • Save aduth/9ee98fb814f37a33ac4fb95c40e985c7 to your computer and use it in GitHub Desktop.
Save aduth/9ee98fb814f37a33ac4fb95c40e985c7 to your computer and use it in GitHub Desktop.
registerStore
/**
* WordPress dependencies
*/
import { registerStore } from '@wordpress/data';
/**
* Internal dependencies
*/
import reducer from './reducer';
import * as actions from './actions';
import * as selectors from './selectors';
export default registerStore( 'core/viewport', {
reducer,
actions,
selectors,
} );
/**
* WordPress dependencies
*/
import {
registerReducer,
registerActions,
registerSelectors,
} from '@wordpress/data';
/**
* Internal dependencies
*/
import reducer from './reducer';
import * as actions from './actions';
import * as selectors from './selectors';
const store = registerReducer( 'core/viewport', reducer );
registerSelectors( 'core/viewport', selectors );
registerActions( 'core/viewport', actions );
export default store;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment