@wordpress/data
Version:
Data module for WordPress.
8 lines (7 loc) • 1.3 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../src/select.ts"],
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { AnyConfig, CurriedSelectorsOf, StoreDescriptor } from './types';\nimport defaultRegistry from './default-registry';\n\n/**\n * Given a store descriptor, returns an object of the store's selectors.\n * The selector functions are been pre-bound to pass the current state automatically.\n * As a consumer, you need only pass arguments of the selector, if applicable.\n *\n *\n * @param storeNameOrDescriptor The store descriptor. The legacy calling convention\n * of passing the store name is also supported.\n *\n * @example\n * ```js\n * import { select } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * select( myCustomStore ).getPrice( 'hammer' );\n * ```\n *\n * @return Object containing the store's selectors.\n */\nexport function select< T extends StoreDescriptor< AnyConfig > >(\n\tstoreNameOrDescriptor: string | T\n): CurriedSelectorsOf< T > {\n\treturn defaultRegistry.select( storeNameOrDescriptor );\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,8BAA4B;AAqBrB,SAAS,OACf,uBAC0B;AAC1B,SAAO,wBAAAA,QAAgB,OAAQ,qBAAsB;AACtD;",
"names": ["defaultRegistry"]
}