4af5eef27b
* bump E2E package versions to latest * first pass on E2E test package.json * move e2e specs to admin-e2e-tests * add global types, reimplement tests/e2e/specs * use consistent build dir with other packages * add documentation, improve test:e2e script * fix linting issues in admin-e2e-tests * fix more linting issues * disable lint on requires * use e2e in the E2E container names * move analytics overview test to package * change extension on analytics-overview test file * fix linting issues in e2e analytics overview * remove package scripts from e2e package * change test specs extensions to .tsx * remove import from analytics overview test spec * add .tsx to e2e test spec file extension list * update e2e business features count expected |
||
---|---|---|
.. | ||
src | ||
.npmrc | ||
CHANGELOG.md | ||
README.md | ||
package.json |
README.md
Data
WooCommerce Admin data store and utilities.
Installation
Install the module
npm install @woocommerce/data --save
This package assumes that your code will run in an ES2015+ environment. If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using core-js or @babel/polyfill will add support for these methods. Learn more about it in Babel docs.
Usage
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
import { useSelect } from '@wordpress/data';
function MySettings() {
const settings = useSelect( select => {
return select( SETTINGS_STORE_NAME ).getSettings();
} );
return (
<ul>
{ settings.map( setting => (
<li>{ setting.name }</li>
) ) }
</ul>
);
}
// Rendered in the application:
//
// <MySettings />