woocommerce/packages/js/data
Miguel Pérez Pellicer dd8f9686fb
Rename Google Listings and Ads with Google for WooCommerce (#47614)
* Rename Google Listings and Ads with Google for WooCommerce

* Revert change regarding changelog

* Add changelogs

* Add changefile(s) from automation for the following project(s): @woocommerce/data, packages/php/remote-specs-validation, woocommerce

* Lint

* Lint

* Lint

* Rename Google Listings and Ads with Google for WooCommerce

* Lint

* Lint

* Tweak updated tests

* Add changefile(s) from automation for the following project(s): @woocommerce/data, packages/php/remote-specs-validation, woocommerce

* Lint

* Fix flaky tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-22 18:59:43 +04:00
..
changelog Rename Google Listings and Ads with Google for WooCommerce (#47614) 2024-07-22 18:59:43 +04:00
src Rename Google Listings and Ads with Google for WooCommerce (#47614) 2024-07-22 18:59:43 +04:00
typings Migrate `@woocommerce/data` user and use-select-with-refresh to TS (#33512) 2022-06-22 17:27:18 +08:00
.eslintrc.js CI: update linting jobs to skip build step (#49193) 2024-07-08 08:39:39 +02:00
.npmrc Moved WCA Packages 2022-03-18 14:25:26 -07:00
CHANGELOG.md Prepare Packages for Release (#48407) 2024-06-11 15:37:33 -07:00
PREVIOUS_CHANGELOG.md Fix/37502: Correct spelling errors. (#37887) 2023-05-08 15:55:09 +08:00
README.md Moved WCA Packages 2022-03-18 14:25:26 -07:00
babel.config.js Update/unify jest@27 across all packages (#34322) 2022-09-06 09:29:45 -05:00
composer.json bump php version in packages/js/*/composer.json (#42020) 2024-01-04 10:18:34 -04:00
composer.lock Update changelogger to 3.3.0 to support PR number capturing with merge (#36266) 2023-01-05 14:42:51 +05:30
jest.config.json Fix Jest Preset (#42707) 2023-12-12 09:58:13 -08:00
package.json Prepare Packages for Release (#48407) 2024-06-11 15:37:33 -07:00
tsconfig-cjs.json Enforce Strict `@types` Dependencies (#37351) 2023-03-23 18:02:20 -07:00
tsconfig.json Enforce Strict `@types` Dependencies (#37351) 2023-03-23 18:02:20 -07:00

README.md

Data

WooCommerce Admin data store and utilities.

Installation

Install the module

pnpm 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 />