@wordpress/data
Version:
Data module for WordPress.
31 lines • 1.07 kB
TypeScript
/**
* Internal dependencies
*/
import { combineReducers } from './combine-reducers';
import type { StoreDescriptor, ReduxStoreConfig } from '../types';
export { combineReducers };
/**
* Creates a data store descriptor for the provided Redux store configuration containing
* properties describing reducer, actions, selectors, controls and resolvers.
*
* @example
* ```js
* import { createReduxStore } from '@wordpress/data';
*
* const store = createReduxStore( 'demo', {
* reducer: ( state = 'OK' ) => state,
* selectors: {
* getValue: ( state ) => state,
* },
* } );
* ```
*
* @param key Unique namespace identifier.
* @param options Registered store options, with properties
* describing reducer, actions, selectors,
* and resolvers.
*
* @return Store Object.
*/
export default function createReduxStore<State, Actions, Selectors>(key: string, options: ReduxStoreConfig<State, Actions, Selectors>): StoreDescriptor<ReduxStoreConfig<State, Actions, Selectors>>;
//# sourceMappingURL=index.d.ts.map