How to use the @wordpress/data.createRegistry function in @wordpress/data

To help you get started, we’ve selected a few @wordpress/data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / block-editor / src / components / provider / with-registry-provider.js View on Github external
useEffect( () => {
			const newRegistry = createRegistry( {}, registry );
			const store = newRegistry.registerStore( 'core/block-editor', storeConfig );
			// This should be removed after the refactoring of the effects to controls.
			applyMiddlewares( store );
			setSubRegistry( newRegistry );
		}, [ registry ] );
github Automattic / wp-calypso / client / state / wp-data / calypso-wp-data-provider.js View on Github external
updateRegistry( calypsoStore ) {
		this.registry = createRegistry()
			.use( internalsPlugin )
			.use( customStorePlugin );

		registerStores( this.registry, calypsoStore );
	}