1e1e428354
* Spike out customer effort score * Refactor CustomerEffortScore as Package (https://github.com/woocommerce/woocommerce-admin/pull/5342) * Tidy up _webpack.config.js * Fix linter issues * refactor setting up CES tracking, add try..catch around loading from localStorage * Add CES feature toggle (https://github.com/woocommerce/woocommerce-admin/pull/5387) * Add feature toggle to only enable the customer effort score in development * Move check into Loader * fix logic 🙄 Co-authored-by: Rebecca Scott <me@becdetat.com> * Add client-side check of the feature flag * fix tabs in config * Fix comment * Use product lifecycle and options * Add product count to tracks props * Use Loader::load_features instead of DIY * Only display the CES modal if tracking is allowed * Move MONTH constant into @woocommerce/data * Remove unused const Co-authored-by: Rebecca Scott <me@becdetat.com> Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com> |
||
---|---|---|
.. | ||
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 />