From 04ca6b494ddcebc6a78c433c3b85416e6fe64d9b Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 31 May 2019 16:35:24 -0400 Subject: [PATCH] Data: Documentation: Document undocumented declarations (#15176) * Data: Documentation: Document plugins * Data: Documentation: Document use --- packages/data/README.md | 18 ++++++++++++++++-- packages/data/src/index.js | 18 +++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/packages/data/README.md b/packages/data/README.md index a5bdfd30a5c37..45a7cdda6f86b 100644 --- a/packages/data/README.md +++ b/packages/data/README.md @@ -358,7 +358,15 @@ _Returns_ # **plugins** -Undocumented declaration. +Object of available plugins to use with a registry. + +_Related_ + +- [use](#use) + +_Type_ + +- `Object` # **registerGenericStore** @@ -470,7 +478,13 @@ _Parameters_ # **use** -Undocumented declaration. +Extends a registry to inherit functionality provided by a given plugin. A +plugin is an object with properties aligning to that of a registry, merged +to extend the default registry behavior. + +_Parameters_ + +- _plugin_ `Object`: Plugin object. # **useRegistry** diff --git a/packages/data/src/index.js b/packages/data/src/index.js index 46c830289b91d..00f1e367eb794 100644 --- a/packages/data/src/index.js +++ b/packages/data/src/index.js @@ -22,9 +22,17 @@ export { AsyncModeProvider as __experimentalAsyncModeProvider, } from './components/async-mode-provider'; export { createRegistry } from './registry'; -export { plugins }; export { createRegistrySelector, createRegistryControl } from './factory'; +/** + * Object of available plugins to use with a registry. + * + * @see [use](#use) + * + * @type {Object} + */ +export { plugins }; + /** * The combineReducers helper function turns an object whose values are different * reducing functions into a single reducing function you can pass to registerReducer. @@ -140,4 +148,12 @@ export const registerGenericStore = defaultRegistry.registerGenericStore; * @return {Object} Registered store object. */ export const registerStore = defaultRegistry.registerStore; + +/** + * Extends a registry to inherit functionality provided by a given plugin. A + * plugin is an object with properties aligning to that of a registry, merged + * to extend the default registry behavior. + * + * @param {Object} plugin Plugin object. + */ export const use = defaultRegistry.use;