@wordpress/data
Version:
Data module for WordPress.
29 lines (27 loc) • 882 B
JavaScript
/**
* Internal dependencies
*/
import defaultRegistry from './default-registry';
/**
* Given a store descriptor, returns an object of the store's selectors.
* The selector functions are been pre-bound to pass the current state automatically.
* As a consumer, you need only pass arguments of the selector, if applicable.
*
*
* @param storeNameOrDescriptor The store descriptor. The legacy calling convention
* of passing the store name is also supported.
*
* @example
* ```js
* import { select } from '@wordpress/data';
* import { store as myCustomStore } from 'my-custom-store';
*
* select( myCustomStore ).getPrice( 'hammer' );
* ```
*
* @return Object containing the store's selectors.
*/
export function select(storeNameOrDescriptor) {
return defaultRegistry.select(storeNameOrDescriptor);
}
//# sourceMappingURL=select.js.map