@wordpress/data 6.1.1 → 6.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/async-mode-provider/context.js +1 -1
- package/build/components/async-mode-provider/index.js +8 -6
- package/build/components/async-mode-provider/index.js.map +1 -1
- package/build/components/registry-provider/index.js +8 -6
- package/build/components/registry-provider/index.js.map +1 -1
- package/build/components/use-dispatch/use-dispatch-with-map.js +3 -1
- package/build/components/use-dispatch/use-dispatch-with-map.js.map +1 -1
- package/build/controls.js +38 -19
- package/build/controls.js.map +1 -1
- package/build/factory.js +4 -2
- package/build/factory.js.map +1 -1
- package/build/index.js +35 -33
- package/build/index.js.map +1 -1
- package/build/plugins/persistence/index.js +2 -1
- package/build/plugins/persistence/index.js.map +1 -1
- package/build/redux-store/index.js +62 -22
- package/build/redux-store/index.js.map +1 -1
- package/build/redux-store/metadata/actions.js +2 -2
- package/build/redux-store/metadata/reducer.js +8 -2
- package/build/redux-store/metadata/reducer.js.map +1 -1
- package/build/redux-store/metadata/selectors.js +8 -5
- package/build/redux-store/metadata/selectors.js.map +1 -1
- package/build/redux-store/metadata/utils.js +5 -5
- package/build/redux-store/metadata/utils.js.map +1 -1
- package/build/registry.js +7 -2
- package/build/registry.js.map +1 -1
- package/build/resolvers-cache-middleware.js +2 -1
- package/build/resolvers-cache-middleware.js.map +1 -1
- package/build/store/index.js +10 -2
- package/build/store/index.js.map +1 -1
- package/build/types.js +6 -0
- package/build/{types.d.js.map → types.js.map} +0 -0
- package/build-module/components/use-dispatch/use-dispatch-with-map.js +3 -1
- package/build-module/components/use-dispatch/use-dispatch-with-map.js.map +1 -1
- package/build-module/controls.js +37 -18
- package/build-module/controls.js.map +1 -1
- package/build-module/factory.js +3 -1
- package/build-module/factory.js.map +1 -1
- package/build-module/redux-store/index.js +58 -20
- package/build-module/redux-store/index.js.map +1 -1
- package/build-module/redux-store/metadata/reducer.js +8 -2
- package/build-module/redux-store/metadata/reducer.js.map +1 -1
- package/build-module/redux-store/metadata/selectors.js +6 -3
- package/build-module/redux-store/metadata/selectors.js.map +1 -1
- package/build-module/redux-store/metadata/utils.js +5 -5
- package/build-module/redux-store/metadata/utils.js.map +1 -1
- package/build-module/registry.js +7 -2
- package/build-module/registry.js.map +1 -1
- package/build-module/resolvers-cache-middleware.js +2 -1
- package/build-module/resolvers-cache-middleware.js.map +1 -1
- package/build-module/store/index.js +10 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/types.js +2 -0
- package/build-module/{types.d.js.map → types.js.map} +0 -0
- package/build-types/types.d.ts +35 -0
- package/build-types/types.d.ts.map +1 -0
- package/package.json +9 -9
- package/src/redux-store/index.js +17 -4
- package/src/{types.d.ts → types.ts} +0 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/types.d.js +0 -2
- package/build-module/types.d.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/data/src/redux-store/metadata/utils.js"],"names":["onSubKey","actionProperty","reducer","state","action","key","undefined","nextKeyState"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,GAAKC,cAAF,IAAwBC,OAAF,IAAe;
|
|
1
|
+
{"version":3,"sources":["@wordpress/data/src/redux-store/metadata/utils.js"],"names":["onSubKey","actionProperty","reducer","state","action","key","undefined","nextKeyState"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,GAAKC,cAAF,IAAwBC,OAAF,IAAe,YAIxD;AAAA,MAFJC,KAEI;AAFI;AAAwC,IAE5C;AAAA,MADJC,MACI;AACJ;AACA;;AACA;;AACA;AACA,QAAMC,GAAG,GAAGD,MAAM,CAAEH,cAAF,CAAlB;;AACA,MAAKI,GAAG,KAAKC,SAAb,EAAyB;AACxB,WAAOH,KAAP;AACA,GARG,CAUJ;AACA;;;AACA,QAAMI,YAAY,GAAGL,OAAO,CAAEC,KAAK,CAAEE,GAAF,CAAP,EAAgBD,MAAhB,CAA5B;;AACA,MAAKG,YAAY,KAAKJ,KAAK,CAAEE,GAAF,CAA3B,EAAqC;AACpC,WAAOF,KAAP;AACA;;AAED,SAAO,EACN,GAAGA,KADG;AAEN,KAAEE,GAAF,GAASE;AAFH,GAAP;AAIA,CAzBM","sourcesContent":["/**\n * Higher-order reducer creator which creates a combined reducer object, keyed\n * by a property on the action object.\n *\n * @template {any} TState\n * @template {import('redux').AnyAction} TAction\n *\n * @param {string} actionProperty Action property by which to key object.\n *\n * @return {(reducer: import('redux').Reducer<TState, TAction>) => import('redux').Reducer<Record<string, TState>, TAction>} Higher-order reducer.\n */\nexport const onSubKey = ( actionProperty ) => ( reducer ) => (\n\t/* eslint-disable jsdoc/no-undefined-types */\n\tstate = /** @type {Record<string, TState>} */ ( {} ),\n\taction\n) => {\n\t// Retrieve subkey from action. Do not track if undefined; useful for cases\n\t// where reducer is scoped by action shape.\n\t/** @type {keyof state} */\n\t/* eslint-enable jsdoc/no-undefined-types */\n\tconst key = action[ actionProperty ];\n\tif ( key === undefined ) {\n\t\treturn state;\n\t}\n\n\t// Avoid updating state if unchanged. Note that this also accounts for a\n\t// reducer which returns undefined on a key which is not yet tracked.\n\tconst nextKeyState = reducer( state[ key ], action );\n\tif ( nextKeyState === state[ key ] ) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\t[ key ]: nextKeyState,\n\t};\n};\n"]}
|
package/build-module/registry.js
CHANGED
|
@@ -48,7 +48,9 @@ import { createEmitter } from './utils/emitter';
|
|
|
48
48
|
* @return {WPDataRegistry} Data registry.
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
export function createRegistry(
|
|
51
|
+
export function createRegistry() {
|
|
52
|
+
let storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
53
|
+
let parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
52
54
|
const stores = {};
|
|
53
55
|
const emitter = createEmitter();
|
|
54
56
|
|
|
@@ -304,7 +306,10 @@ export function createRegistry(storeConfigs = {}, parent = null) {
|
|
|
304
306
|
}
|
|
305
307
|
|
|
306
308
|
registerGenericStore(STORE_NAME, createCoreDataStore(registry));
|
|
307
|
-
Object.entries(storeConfigs).forEach(
|
|
309
|
+
Object.entries(storeConfigs).forEach(_ref => {
|
|
310
|
+
let [name, config] = _ref;
|
|
311
|
+
return registry.registerStore(name, config);
|
|
312
|
+
});
|
|
308
313
|
|
|
309
314
|
if (parent) {
|
|
310
315
|
parent.subscribe(globalListener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/data/src/registry.js"],"names":["mapValues","isObject","forEach","createReduxStore","createCoreDataStore","STORE_NAME","createEmitter","createRegistry","storeConfigs","parent","stores","emitter","__experimentalListeningStores","Set","globalListener","emit","subscribe","listener","select","storeNameOrDefinition","storeName","name","add","store","getSelectors","__experimentalMarkListeningStores","callback","ref","clear","result","call","current","Array","from","resolveSelect","getResolveSelectors","dispatch","getActions","withPlugins","attributes","attribute","key","registry","apply","arguments","registerGenericStore","config","TypeError","currentSubscribe","unsubscribeFromStoreEmitter","unsubscribeFromRootStore","isPaused","register","instantiate","__experimentalSubscribeStore","handler","batch","pause","resume","namespaces","use","registerStore","options","reducer","plugin","Object","entries"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,EAA8BC,OAA9B,QAA6C,QAA7C;AAEA;AACA;AACA;;AACA,OAAOC,gBAAP,MAA6B,eAA7B;AACA,OAAOC,mBAAP,MAAgC,SAAhC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;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AMxB,KAAK,GAAGpB,gBAAgB,CAAEiB,SAAF,EAAa0C,OAAb,CAAhB,CAAuCT,WAAvC,CACbX,QADa,CAAd;AAGAG,IAAAA,oBAAoB,CAAEzB,SAAF,EAAaG,KAAb,CAApB;AACA,WAAOA,KAAK,CAACA,KAAb;AACA,GAVD,CAzNkE,CAqOlE;AACA;AACA;AACA;;;AACA,WAASqC,GAAT,CAAcI,MAAd,EAAsBF,OAAtB,EAAgC;AAC/BpB,IAAAA,QAAQ,GAAG,EACV,GAAGA,QADO;AAEV,SAAGsB,MAAM,CAAEtB,QAAF,EAAYoB,OAAZ;AAFC,KAAX;AAKA,WAAOpB,QAAP;AACA;;AAEDG,EAAAA,oBAAoB,CAAExC,UAAF,EAAcD,mBAAmB,CAAEsC,QAAF,CAAjC,CAApB;AAEAuB,EAAAA,MAAM,CAACC,OAAP,CAAgB1D,YAAhB,EAA+BN,OAA/B,CAAwC,CAAE,CAAEmB,IAAF,EAAQyB,MAAR,CAAF,KACvCJ,QAAQ,CAACmB,aAAT,CAAwBxC,IAAxB,EAA8ByB,MAA9B,CADD;;AAIA,MAAKrC,MAAL,EAAc;AACbA,IAAAA,MAAM,CAACO,SAAP,CAAkBF,cAAlB;AACA;;AAED,SAAOwB,WAAW,CAAEI,QAAF,CAAlB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { mapValues, isObject, forEach } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport createReduxStore from './redux-store';\nimport createCoreDataStore from './store';\nimport { STORE_NAME } from './store/name';\nimport { createEmitter } from './utils/emitter';\n\n/** @typedef {import('./types').WPDataStore} WPDataStore */\n\n/**\n * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.\n *\n * @property {Function} registerGenericStore Given a namespace key and settings\n * object, registers a new generic\n * store.\n * @property {Function} registerStore Given a namespace key and settings\n * object, registers a new namespace\n * store.\n * @property {Function} subscribe Given a function callback, invokes\n * the callback on any change to state\n * within any registered store.\n * @property {Function} select Given a namespace key, returns an\n * object of the store's registered\n * selectors.\n * @property {Function} dispatch Given a namespace key, returns an\n * object of the store's registered\n * action dispatchers.\n */\n\n/**\n * @typedef {Object} WPDataPlugin An object of registry function overrides.\n *\n * @property {Function} registerStore registers store.\n */\n\n/**\n * Creates a new store registry, given an optional object of initial store\n * configurations.\n *\n * @param {Object} storeConfigs Initial store configurations.\n * @param {Object?} parent Parent registry.\n *\n * @return {WPDataRegistry} Data registry.\n */\nexport function createRegistry( storeConfigs = {}, parent = null ) {\n\tconst stores = {};\n\tconst emitter = createEmitter();\n\tconst __experimentalListeningStores = new Set();\n\n\t/**\n\t * Global listener called for each store's update.\n\t */\n\tfunction globalListener() {\n\t\temitter.emit();\n\t}\n\n\t/**\n\t * Subscribe to changes to any data.\n\t *\n\t * @param {Function} listener Listener function.\n\t *\n\t * @return {Function} Unsubscribe function.\n\t */\n\tconst subscribe = ( listener ) => {\n\t\treturn emitter.subscribe( listener );\n\t};\n\n\t/**\n\t * Calls a selector given the current state and extra arguments.\n\t *\n\t * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store\n\t * or the store definition.\n\t *\n\t * @return {*} The selector's returned value.\n\t */\n\tfunction select( storeNameOrDefinition ) {\n\t\tconst storeName = isObject( storeNameOrDefinition )\n\t\t\t? storeNameOrDefinition.name\n\t\t\t: storeNameOrDefinition;\n\t\t__experimentalListeningStores.add( storeName );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getSelectors();\n\t\t}\n\n\t\treturn parent && parent.select( storeName );\n\t}\n\n\tfunction __experimentalMarkListeningStores( callback, ref ) {\n\t\t__experimentalListeningStores.clear();\n\t\tconst result = callback.call( this );\n\t\tref.current = Array.from( __experimentalListeningStores );\n\t\treturn result;\n\t}\n\n\t/**\n\t * Given the name of a registered store, returns an object containing the store's\n\t * selectors pre-bound to state so that you only need to supply additional arguments,\n\t * and modified so that they return promises that resolve to their eventual values,\n\t * after any resolvers have ran.\n\t *\n\t * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store\n\t * or the store definition.\n\t *\n\t * @return {Object} Each key of the object matches the name of a selector.\n\t */\n\tfunction resolveSelect( storeNameOrDefinition ) {\n\t\tconst storeName = isObject( storeNameOrDefinition )\n\t\t\t? storeNameOrDefinition.name\n\t\t\t: storeNameOrDefinition;\n\t\t__experimentalListeningStores.add( storeName );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getResolveSelectors();\n\t\t}\n\n\t\treturn parent && parent.resolveSelect( storeName );\n\t}\n\n\t/**\n\t * Returns the available actions for a part of the state.\n\t *\n\t * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store\n\t * or the store definition.\n\t *\n\t * @return {*} The action's returned value.\n\t */\n\tfunction dispatch( storeNameOrDefinition ) {\n\t\tconst storeName = isObject( storeNameOrDefinition )\n\t\t\t? storeNameOrDefinition.name\n\t\t\t: storeNameOrDefinition;\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getActions();\n\t\t}\n\n\t\treturn parent && parent.dispatch( storeName );\n\t}\n\n\t//\n\t// Deprecated\n\t// TODO: Remove this after `use()` is removed.\n\t//\n\tfunction withPlugins( attributes ) {\n\t\treturn mapValues( attributes, ( attribute, key ) => {\n\t\t\tif ( typeof attribute !== 'function' ) {\n\t\t\t\treturn attribute;\n\t\t\t}\n\t\t\treturn function () {\n\t\t\t\treturn registry[ key ].apply( null, arguments );\n\t\t\t};\n\t\t} );\n\t}\n\n\t/**\n\t * Registers a generic store.\n\t *\n\t * @param {string} key Store registry key.\n\t * @param {Object} config Configuration (getSelectors, getActions, subscribe).\n\t */\n\tfunction registerGenericStore( key, config ) {\n\t\tif ( typeof config.getSelectors !== 'function' ) {\n\t\t\tthrow new TypeError( 'config.getSelectors must be a function' );\n\t\t}\n\t\tif ( typeof config.getActions !== 'function' ) {\n\t\t\tthrow new TypeError( 'config.getActions must be a function' );\n\t\t}\n\t\tif ( typeof config.subscribe !== 'function' ) {\n\t\t\tthrow new TypeError( 'config.subscribe must be a function' );\n\t\t}\n\t\t// Thi emitter is used to keep track of active listeners when the registry\n\t\t// get paused, that way, when resumed we should be able to call all these\n\t\t// pending listeners.\n\t\tconfig.emitter = createEmitter();\n\t\tconst currentSubscribe = config.subscribe;\n\t\tconfig.subscribe = ( listener ) => {\n\t\t\tconst unsubscribeFromStoreEmitter = config.emitter.subscribe(\n\t\t\t\tlistener\n\t\t\t);\n\t\t\tconst unsubscribeFromRootStore = currentSubscribe( () => {\n\t\t\t\tif ( config.emitter.isPaused ) {\n\t\t\t\t\tconfig.emitter.emit();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlistener();\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( unsubscribeFromRootStore ) {\n\t\t\t\t\tunsubscribeFromRootStore();\n\t\t\t\t}\n\t\t\t\tunsubscribeFromStoreEmitter();\n\t\t\t};\n\t\t};\n\t\tstores[ key ] = config;\n\t\tconfig.subscribe( globalListener );\n\t}\n\n\t/**\n\t * Registers a new store definition.\n\t *\n\t * @param {WPDataStore} store Store definition.\n\t */\n\tfunction register( store ) {\n\t\tregisterGenericStore( store.name, store.instantiate( registry ) );\n\t}\n\n\t/**\n\t * Subscribe handler to a store.\n\t *\n\t * @param {string[]} storeName The store name.\n\t * @param {Function} handler The function subscribed to the store.\n\t * @return {Function} A function to unsubscribe the handler.\n\t */\n\tfunction __experimentalSubscribeStore( storeName, handler ) {\n\t\tif ( storeName in stores ) {\n\t\t\treturn stores[ storeName ].subscribe( handler );\n\t\t}\n\n\t\t// Trying to access a store that hasn't been registered,\n\t\t// this is a pattern rarely used but seen in some places.\n\t\t// We fallback to regular `subscribe` here for backward-compatibility for now.\n\t\t// See https://github.com/WordPress/gutenberg/pull/27466 for more info.\n\t\tif ( ! parent ) {\n\t\t\treturn subscribe( handler );\n\t\t}\n\n\t\treturn parent.__experimentalSubscribeStore( storeName, handler );\n\t}\n\n\tfunction batch( callback ) {\n\t\temitter.pause();\n\t\tforEach( stores, ( store ) => store.emitter.pause() );\n\t\tcallback();\n\t\temitter.resume();\n\t\tforEach( stores, ( store ) => store.emitter.resume() );\n\t}\n\n\tlet registry = {\n\t\tbatch,\n\t\tregisterGenericStore,\n\t\tstores,\n\t\tnamespaces: stores, // TODO: Deprecate/remove this.\n\t\tsubscribe,\n\t\tselect,\n\t\tresolveSelect,\n\t\tdispatch,\n\t\tuse,\n\t\tregister,\n\t\t__experimentalMarkListeningStores,\n\t\t__experimentalSubscribeStore,\n\t};\n\n\t/**\n\t * Registers a standard `@wordpress/data` store.\n\t *\n\t * @param {string} storeName Unique namespace identifier.\n\t * @param {Object} options Store description (reducer, actions, selectors, resolvers).\n\t *\n\t * @return {Object} Registered store object.\n\t */\n\tregistry.registerStore = ( storeName, options ) => {\n\t\tif ( ! options.reducer ) {\n\t\t\tthrow new TypeError( 'Must specify store reducer' );\n\t\t}\n\n\t\tconst store = createReduxStore( storeName, options ).instantiate(\n\t\t\tregistry\n\t\t);\n\t\tregisterGenericStore( storeName, store );\n\t\treturn store.store;\n\t};\n\n\t//\n\t// TODO:\n\t// This function will be deprecated as soon as it is no longer internally referenced.\n\t//\n\tfunction use( plugin, options ) {\n\t\tregistry = {\n\t\t\t...registry,\n\t\t\t...plugin( registry, options ),\n\t\t};\n\n\t\treturn registry;\n\t}\n\n\tregisterGenericStore( STORE_NAME, createCoreDataStore( registry ) );\n\n\tObject.entries( storeConfigs ).forEach( ( [ name, config ] ) =>\n\t\tregistry.registerStore( name, config )\n\t);\n\n\tif ( parent ) {\n\t\tparent.subscribe( globalListener );\n\t}\n\n\treturn withPlugins( registry );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/data/src/registry.js"],"names":["mapValues","isObject","forEach","createReduxStore","createCoreDataStore","STORE_NAME","createEmitter","createRegistry","storeConfigs","parent","stores","emitter","__experimentalListeningStores","Set","globalListener","emit","subscribe","listener","select","storeNameOrDefinition","storeName","name","add","store","getSelectors","__experimentalMarkListeningStores","callback","ref","clear","result","call","current","Array","from","resolveSelect","getResolveSelectors","dispatch","getActions","withPlugins","attributes","attribute","key","registry","apply","arguments","registerGenericStore","config","TypeError","currentSubscribe","unsubscribeFromStoreEmitter","unsubscribeFromRootStore","isPaused","register","instantiate","__experimentalSubscribeStore","handler","batch","pause","resume","namespaces","use","registerStore","options","reducer","plugin","Object","entries"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,EAA8BC,OAA9B,QAA6C,QAA7C;AAEA;AACA;AACA;;AACA,OAAOC,gBAAP,MAA6B,eAA7B;AACA,OAAOC,mBAAP,MAAgC,SAAhC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,cAAT,GAA4D;AAAA,MAAnCC,YAAmC,uEAApB,EAAoB;AAAA,MAAhBC,MAAgB,uEAAP,IAAO;AAClE,QAAMC,MAAM,GAAG,EAAf;AACA,QAAMC,OAAO,GAAGL,aAAa,EAA7B;;AACA,QAAMM,6BAA6B,GAAG,IAAIC,GAAJ,EAAtC;AAEA;AACD;AACA;;;AACC,WAASC,cAAT,GAA0B;AACzBH,IAAAA,OAAO,CAACI,IAAR;AACA;AAED;AACD;AACA;AACA;AACA;AACA;AACA;;;AACC,QAAMC,SAAS,GAAKC,QAAF,IAAgB;AACjC,WAAON,OAAO,CAACK,SAAR,CAAmBC,QAAnB,CAAP;AACA,GAFD;AAIA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;AACC,WAASC,MAAT,CAAiBC,qBAAjB,EAAyC;AACxC,UAAMC,SAAS,GAAGnB,QAAQ,CAAEkB,qBAAF,CAAR,GAC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AR,CAAF;AAAA,WACvCJ,QAAQ,CAACmB,aAAT,CAAwBxC,IAAxB,EAA8ByB,MAA9B,CADuC;AAAA,GAAxC;;AAIA,MAAKrC,MAAL,EAAc;AACbA,IAAAA,MAAM,CAACO,SAAP,CAAkBF,cAAlB;AACA;;AAED,SAAOwB,WAAW,CAAEI,QAAF,CAAlB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { mapValues, isObject, forEach } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport createReduxStore from './redux-store';\nimport createCoreDataStore from './store';\nimport { STORE_NAME } from './store/name';\nimport { createEmitter } from './utils/emitter';\n\n/** @typedef {import('./types').WPDataStore} WPDataStore */\n\n/**\n * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.\n *\n * @property {Function} registerGenericStore Given a namespace key and settings\n * object, registers a new generic\n * store.\n * @property {Function} registerStore Given a namespace key and settings\n * object, registers a new namespace\n * store.\n * @property {Function} subscribe Given a function callback, invokes\n * the callback on any change to state\n * within any registered store.\n * @property {Function} select Given a namespace key, returns an\n * object of the store's registered\n * selectors.\n * @property {Function} dispatch Given a namespace key, returns an\n * object of the store's registered\n * action dispatchers.\n */\n\n/**\n * @typedef {Object} WPDataPlugin An object of registry function overrides.\n *\n * @property {Function} registerStore registers store.\n */\n\n/**\n * Creates a new store registry, given an optional object of initial store\n * configurations.\n *\n * @param {Object} storeConfigs Initial store configurations.\n * @param {Object?} parent Parent registry.\n *\n * @return {WPDataRegistry} Data registry.\n */\nexport function createRegistry( storeConfigs = {}, parent = null ) {\n\tconst stores = {};\n\tconst emitter = createEmitter();\n\tconst __experimentalListeningStores = new Set();\n\n\t/**\n\t * Global listener called for each store's update.\n\t */\n\tfunction globalListener() {\n\t\temitter.emit();\n\t}\n\n\t/**\n\t * Subscribe to changes to any data.\n\t *\n\t * @param {Function} listener Listener function.\n\t *\n\t * @return {Function} Unsubscribe function.\n\t */\n\tconst subscribe = ( listener ) => {\n\t\treturn emitter.subscribe( listener );\n\t};\n\n\t/**\n\t * Calls a selector given the current state and extra arguments.\n\t *\n\t * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store\n\t * or the store definition.\n\t *\n\t * @return {*} The selector's returned value.\n\t */\n\tfunction select( storeNameOrDefinition ) {\n\t\tconst storeName = isObject( storeNameOrDefinition )\n\t\t\t? storeNameOrDefinition.name\n\t\t\t: storeNameOrDefinition;\n\t\t__experimentalListeningStores.add( storeName );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getSelectors();\n\t\t}\n\n\t\treturn parent && parent.select( storeName );\n\t}\n\n\tfunction __experimentalMarkListeningStores( callback, ref ) {\n\t\t__experimentalListeningStores.clear();\n\t\tconst result = callback.call( this );\n\t\tref.current = Array.from( __experimentalListeningStores );\n\t\treturn result;\n\t}\n\n\t/**\n\t * Given the name of a registered store, returns an object containing the store's\n\t * selectors pre-bound to state so that you only need to supply additional arguments,\n\t * and modified so that they return promises that resolve to their eventual values,\n\t * after any resolvers have ran.\n\t *\n\t * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store\n\t * or the store definition.\n\t *\n\t * @return {Object} Each key of the object matches the name of a selector.\n\t */\n\tfunction resolveSelect( storeNameOrDefinition ) {\n\t\tconst storeName = isObject( storeNameOrDefinition )\n\t\t\t? storeNameOrDefinition.name\n\t\t\t: storeNameOrDefinition;\n\t\t__experimentalListeningStores.add( storeName );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getResolveSelectors();\n\t\t}\n\n\t\treturn parent && parent.resolveSelect( storeName );\n\t}\n\n\t/**\n\t * Returns the available actions for a part of the state.\n\t *\n\t * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store\n\t * or the store definition.\n\t *\n\t * @return {*} The action's returned value.\n\t */\n\tfunction dispatch( storeNameOrDefinition ) {\n\t\tconst storeName = isObject( storeNameOrDefinition )\n\t\t\t? storeNameOrDefinition.name\n\t\t\t: storeNameOrDefinition;\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getActions();\n\t\t}\n\n\t\treturn parent && parent.dispatch( storeName );\n\t}\n\n\t//\n\t// Deprecated\n\t// TODO: Remove this after `use()` is removed.\n\t//\n\tfunction withPlugins( attributes ) {\n\t\treturn mapValues( attributes, ( attribute, key ) => {\n\t\t\tif ( typeof attribute !== 'function' ) {\n\t\t\t\treturn attribute;\n\t\t\t}\n\t\t\treturn function () {\n\t\t\t\treturn registry[ key ].apply( null, arguments );\n\t\t\t};\n\t\t} );\n\t}\n\n\t/**\n\t * Registers a generic store.\n\t *\n\t * @param {string} key Store registry key.\n\t * @param {Object} config Configuration (getSelectors, getActions, subscribe).\n\t */\n\tfunction registerGenericStore( key, config ) {\n\t\tif ( typeof config.getSelectors !== 'function' ) {\n\t\t\tthrow new TypeError( 'config.getSelectors must be a function' );\n\t\t}\n\t\tif ( typeof config.getActions !== 'function' ) {\n\t\t\tthrow new TypeError( 'config.getActions must be a function' );\n\t\t}\n\t\tif ( typeof config.subscribe !== 'function' ) {\n\t\t\tthrow new TypeError( 'config.subscribe must be a function' );\n\t\t}\n\t\t// Thi emitter is used to keep track of active listeners when the registry\n\t\t// get paused, that way, when resumed we should be able to call all these\n\t\t// pending listeners.\n\t\tconfig.emitter = createEmitter();\n\t\tconst currentSubscribe = config.subscribe;\n\t\tconfig.subscribe = ( listener ) => {\n\t\t\tconst unsubscribeFromStoreEmitter = config.emitter.subscribe(\n\t\t\t\tlistener\n\t\t\t);\n\t\t\tconst unsubscribeFromRootStore = currentSubscribe( () => {\n\t\t\t\tif ( config.emitter.isPaused ) {\n\t\t\t\t\tconfig.emitter.emit();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlistener();\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( unsubscribeFromRootStore ) {\n\t\t\t\t\tunsubscribeFromRootStore();\n\t\t\t\t}\n\t\t\t\tunsubscribeFromStoreEmitter();\n\t\t\t};\n\t\t};\n\t\tstores[ key ] = config;\n\t\tconfig.subscribe( globalListener );\n\t}\n\n\t/**\n\t * Registers a new store definition.\n\t *\n\t * @param {WPDataStore} store Store definition.\n\t */\n\tfunction register( store ) {\n\t\tregisterGenericStore( store.name, store.instantiate( registry ) );\n\t}\n\n\t/**\n\t * Subscribe handler to a store.\n\t *\n\t * @param {string[]} storeName The store name.\n\t * @param {Function} handler The function subscribed to the store.\n\t * @return {Function} A function to unsubscribe the handler.\n\t */\n\tfunction __experimentalSubscribeStore( storeName, handler ) {\n\t\tif ( storeName in stores ) {\n\t\t\treturn stores[ storeName ].subscribe( handler );\n\t\t}\n\n\t\t// Trying to access a store that hasn't been registered,\n\t\t// this is a pattern rarely used but seen in some places.\n\t\t// We fallback to regular `subscribe` here for backward-compatibility for now.\n\t\t// See https://github.com/WordPress/gutenberg/pull/27466 for more info.\n\t\tif ( ! parent ) {\n\t\t\treturn subscribe( handler );\n\t\t}\n\n\t\treturn parent.__experimentalSubscribeStore( storeName, handler );\n\t}\n\n\tfunction batch( callback ) {\n\t\temitter.pause();\n\t\tforEach( stores, ( store ) => store.emitter.pause() );\n\t\tcallback();\n\t\temitter.resume();\n\t\tforEach( stores, ( store ) => store.emitter.resume() );\n\t}\n\n\tlet registry = {\n\t\tbatch,\n\t\tregisterGenericStore,\n\t\tstores,\n\t\tnamespaces: stores, // TODO: Deprecate/remove this.\n\t\tsubscribe,\n\t\tselect,\n\t\tresolveSelect,\n\t\tdispatch,\n\t\tuse,\n\t\tregister,\n\t\t__experimentalMarkListeningStores,\n\t\t__experimentalSubscribeStore,\n\t};\n\n\t/**\n\t * Registers a standard `@wordpress/data` store.\n\t *\n\t * @param {string} storeName Unique namespace identifier.\n\t * @param {Object} options Store description (reducer, actions, selectors, resolvers).\n\t *\n\t * @return {Object} Registered store object.\n\t */\n\tregistry.registerStore = ( storeName, options ) => {\n\t\tif ( ! options.reducer ) {\n\t\t\tthrow new TypeError( 'Must specify store reducer' );\n\t\t}\n\n\t\tconst store = createReduxStore( storeName, options ).instantiate(\n\t\t\tregistry\n\t\t);\n\t\tregisterGenericStore( storeName, store );\n\t\treturn store.store;\n\t};\n\n\t//\n\t// TODO:\n\t// This function will be deprecated as soon as it is no longer internally referenced.\n\t//\n\tfunction use( plugin, options ) {\n\t\tregistry = {\n\t\t\t...registry,\n\t\t\t...plugin( registry, options ),\n\t\t};\n\n\t\treturn registry;\n\t}\n\n\tregisterGenericStore( STORE_NAME, createCoreDataStore( registry ) );\n\n\tObject.entries( storeConfigs ).forEach( ( [ name, config ] ) =>\n\t\tregistry.registerStore( name, config )\n\t);\n\n\tif ( parent ) {\n\t\tparent.subscribe( globalListener );\n\t}\n\n\treturn withPlugins( registry );\n}\n"]}
|
|
@@ -22,7 +22,8 @@ import { STORE_NAME } from './store/name';
|
|
|
22
22
|
|
|
23
23
|
const createResolversCacheMiddleware = (registry, reducerKey) => () => next => action => {
|
|
24
24
|
const resolvers = registry.select(STORE_NAME).getCachedResolvers(reducerKey);
|
|
25
|
-
Object.entries(resolvers).forEach(
|
|
25
|
+
Object.entries(resolvers).forEach(_ref => {
|
|
26
|
+
let [selectorName, resolversByArgs] = _ref;
|
|
26
27
|
const resolver = get(registry.stores, [reducerKey, 'resolvers', selectorName]);
|
|
27
28
|
|
|
28
29
|
if (!resolver || !resolver.shouldInvalidate) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/data/src/resolvers-cache-middleware.js"],"names":["get","STORE_NAME","createResolversCacheMiddleware","registry","reducerKey","next","action","resolvers","select","getCachedResolvers","Object","entries","forEach","selectorName","resolversByArgs","resolver","stores","shouldInvalidate","value","args","dispatch","invalidateResolution"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,8BAA8B,GAAG,CAAEC,QAAF,EAAYC,UAAZ,KAA4B,MAClEC,IADwE,IAElEC,MAAF,IAAc;AAClB,QAAMC,SAAS,GAAGJ,QAAQ,CACxBK,MADgB,CACRP,UADQ,EAEhBQ,kBAFgB,CAEIL,UAFJ,CAAlB;AAGAM,EAAAA,MAAM,CAACC,OAAP,CAAgBJ,SAAhB,EAA4BK,OAA5B,CACC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/data/src/resolvers-cache-middleware.js"],"names":["get","STORE_NAME","createResolversCacheMiddleware","registry","reducerKey","next","action","resolvers","select","getCachedResolvers","Object","entries","forEach","selectorName","resolversByArgs","resolver","stores","shouldInvalidate","value","args","dispatch","invalidateResolution"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,8BAA8B,GAAG,CAAEC,QAAF,EAAYC,UAAZ,KAA4B,MAClEC,IADwE,IAElEC,MAAF,IAAc;AAClB,QAAMC,SAAS,GAAGJ,QAAQ,CACxBK,MADgB,CACRP,UADQ,EAEhBQ,kBAFgB,CAEIL,UAFJ,CAAlB;AAGAM,EAAAA,MAAM,CAACC,OAAP,CAAgBJ,SAAhB,EAA4BK,OAA5B,CACC,QAAyC;AAAA,QAAvC,CAAEC,YAAF,EAAgBC,eAAhB,CAAuC;AACxC,UAAMC,QAAQ,GAAGf,GAAG,CAAEG,QAAQ,CAACa,MAAX,EAAmB,CACtCZ,UADsC,EAEtC,WAFsC,EAGtCS,YAHsC,CAAnB,CAApB;;AAKA,QAAK,CAAEE,QAAF,IAAc,CAAEA,QAAQ,CAACE,gBAA9B,EAAiD;AAChD;AACA;;AACDH,IAAAA,eAAe,CAACF,OAAhB,CAAyB,CAAEM,KAAF,EAASC,IAAT,KAAmB;AAC3C;AACA;AACA;AACA,UACCD,KAAK,KAAK,KAAV,IACA,CAAEH,QAAQ,CAACE,gBAAT,CAA2BX,MAA3B,EAAmC,GAAGa,IAAtC,CAFH,EAGE;AACD;AACA,OAT0C,CAW3C;;;AACAhB,MAAAA,QAAQ,CACNiB,QADF,CACYnB,UADZ,EAEEoB,oBAFF,CAEwBjB,UAFxB,EAEoCS,YAFpC,EAEkDM,IAFlD;AAGA,KAfD;AAgBA,GA1BF;AA4BA,SAAOd,IAAI,CAAEC,MAAF,CAAX;AACA,CAnCD;;AAqCA,eAAeJ,8BAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from './store/name';\n\n/** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */\n\n/**\n * Creates a middleware handling resolvers cache invalidation.\n *\n * @param {WPDataRegistry} registry The registry reference for which to create\n * the middleware.\n * @param {string} reducerKey The namespace for which to create the\n * middleware.\n *\n * @return {Function} Middleware function.\n */\nconst createResolversCacheMiddleware = ( registry, reducerKey ) => () => (\n\tnext\n) => ( action ) => {\n\tconst resolvers = registry\n\t\t.select( STORE_NAME )\n\t\t.getCachedResolvers( reducerKey );\n\tObject.entries( resolvers ).forEach(\n\t\t( [ selectorName, resolversByArgs ] ) => {\n\t\t\tconst resolver = get( registry.stores, [\n\t\t\t\treducerKey,\n\t\t\t\t'resolvers',\n\t\t\t\tselectorName,\n\t\t\t] );\n\t\t\tif ( ! resolver || ! resolver.shouldInvalidate ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolversByArgs.forEach( ( value, args ) => {\n\t\t\t\t// resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.\n\t\t\t\t// If the value is false it means this resolver has finished its resolution which means we need to invalidate it,\n\t\t\t\t// if it's true it means it's inflight and the invalidation is not necessary.\n\t\t\t\tif (\n\t\t\t\t\tvalue !== false ||\n\t\t\t\t\t! resolver.shouldInvalidate( action, ...args )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Trigger cache invalidation\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( STORE_NAME )\n\t\t\t\t\t.invalidateResolution( reducerKey, selectorName, args );\n\t\t\t} );\n\t\t}\n\t);\n\treturn next( action );\n};\n\nexport default createResolversCacheMiddleware;\n"]}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
function createCoreDataStore(registry) {
|
|
2
|
-
const getCoreDataSelector = selectorName => (key
|
|
2
|
+
const getCoreDataSelector = selectorName => function (key) {
|
|
3
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
4
|
+
args[_key - 1] = arguments[_key];
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
return registry.select(key)[selectorName](...args);
|
|
4
8
|
};
|
|
5
9
|
|
|
6
|
-
const getCoreDataAction = actionName => (key
|
|
10
|
+
const getCoreDataAction = actionName => function (key) {
|
|
11
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
12
|
+
args[_key2 - 1] = arguments[_key2];
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
return registry.dispatch(key)[actionName](...args);
|
|
8
16
|
};
|
|
9
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/data/src/store/index.js"],"names":["createCoreDataStore","registry","getCoreDataSelector","selectorName","key","args","select","getCoreDataAction","actionName","dispatch","getSelectors","reduce","memo","getActions","subscribe"],"mappings":"AAAA,SAASA,mBAAT,CAA8BC,QAA9B,EAAyC;AACxC,QAAMC,mBAAmB,GAAKC,YAAF,IAAoB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/data/src/store/index.js"],"names":["createCoreDataStore","registry","getCoreDataSelector","selectorName","key","args","select","getCoreDataAction","actionName","dispatch","getSelectors","reduce","memo","getActions","subscribe"],"mappings":"AAAA,SAASA,mBAAT,CAA8BC,QAA9B,EAAyC;AACxC,QAAMC,mBAAmB,GAAKC,YAAF,IAAoB,UAAEC,GAAF,EAAoB;AAAA,sCAAVC,IAAU;AAAVA,MAAAA,IAAU;AAAA;;AACnE,WAAOJ,QAAQ,CAACK,MAAT,CAAiBF,GAAjB,EAAwBD,YAAxB,EAAwC,GAAGE,IAA3C,CAAP;AACA,GAFD;;AAIA,QAAME,iBAAiB,GAAKC,UAAF,IAAkB,UAAEJ,GAAF,EAAoB;AAAA,uCAAVC,IAAU;AAAVA,MAAAA,IAAU;AAAA;;AAC/D,WAAOJ,QAAQ,CAACQ,QAAT,CAAmBL,GAAnB,EAA0BI,UAA1B,EAAwC,GAAGH,IAA3C,CAAP;AACA,GAFD;;AAIA,SAAO;AACNK,IAAAA,YAAY,GAAG;AACd,aAAO,CACN,gBADM,EAEN,sBAFM,EAGN,uBAHM,EAIN,aAJM,EAKN,oBALM,EAMLC,MANK,CAON,CAAEC,IAAF,EAAQT,YAAR,MAA4B,EAC3B,GAAGS,IADwB;AAE3B,SAAET,YAAF,GAAkBD,mBAAmB,CAAEC,YAAF;AAFV,OAA5B,CAPM,EAWN,EAXM,CAAP;AAaA,KAfK;;AAiBNU,IAAAA,UAAU,GAAG;AACZ,aAAO,CACN,iBADM,EAEN,kBAFM,EAGN,sBAHM,EAIN,8BAJM,EAKN,sCALM,EAMLF,MANK,CAON,CAAEC,IAAF,EAAQJ,UAAR,MAA0B,EACzB,GAAGI,IADsB;AAEzB,SAAEJ,UAAF,GAAgBD,iBAAiB,CAAEC,UAAF;AAFR,OAA1B,CAPM,EAWN,EAXM,CAAP;AAaA,KA/BK;;AAiCNM,IAAAA,SAAS,GAAG;AACX;AACA;AACA;AACA;AACA,aAAO,MAAM,CAAE,CAAf;AACA;;AAvCK,GAAP;AAyCA;;AAED,eAAed,mBAAf","sourcesContent":["function createCoreDataStore( registry ) {\n\tconst getCoreDataSelector = ( selectorName ) => ( key, ...args ) => {\n\t\treturn registry.select( key )[ selectorName ]( ...args );\n\t};\n\n\tconst getCoreDataAction = ( actionName ) => ( key, ...args ) => {\n\t\treturn registry.dispatch( key )[ actionName ]( ...args );\n\t};\n\n\treturn {\n\t\tgetSelectors() {\n\t\t\treturn [\n\t\t\t\t'getIsResolving',\n\t\t\t\t'hasStartedResolution',\n\t\t\t\t'hasFinishedResolution',\n\t\t\t\t'isResolving',\n\t\t\t\t'getCachedResolvers',\n\t\t\t].reduce(\n\t\t\t\t( memo, selectorName ) => ( {\n\t\t\t\t\t...memo,\n\t\t\t\t\t[ selectorName ]: getCoreDataSelector( selectorName ),\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t);\n\t\t},\n\n\t\tgetActions() {\n\t\t\treturn [\n\t\t\t\t'startResolution',\n\t\t\t\t'finishResolution',\n\t\t\t\t'invalidateResolution',\n\t\t\t\t'invalidateResolutionForStore',\n\t\t\t\t'invalidateResolutionForStoreSelector',\n\t\t\t].reduce(\n\t\t\t\t( memo, actionName ) => ( {\n\t\t\t\t\t...memo,\n\t\t\t\t\t[ actionName ]: getCoreDataAction( actionName ),\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t);\n\t\t},\n\n\t\tsubscribe() {\n\t\t\t// There's no reasons to trigger any listener when we subscribe to this store\n\t\t\t// because there's no state stored in this store that need to retrigger selectors\n\t\t\t// if a change happens, the corresponding store where the tracking stated live\n\t\t\t// would have already triggered a \"subscribe\" call.\n\t\t\treturn () => {};\n\t\t},\n\t};\n}\n\nexport default createCoreDataStore;\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare type WPDataFunctionOrGeneratorArray = Array<Function | Generator>;
|
|
2
|
+
export declare type WPDataFunctionArray = Array<Function>;
|
|
3
|
+
export interface WPDataAttachedStore {
|
|
4
|
+
getSelectors: () => WPDataFunctionArray;
|
|
5
|
+
getActions: () => WPDataFunctionArray;
|
|
6
|
+
subscribe: (listener: () => void) => () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface WPDataStore {
|
|
9
|
+
/**
|
|
10
|
+
* Store Name
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Store configuration object.
|
|
15
|
+
*/
|
|
16
|
+
instantiate: (registry: WPDataRegistry) => WPDataAttachedStore;
|
|
17
|
+
}
|
|
18
|
+
export interface WPDataReduxStoreConfig {
|
|
19
|
+
reducer: (state: any, action: any) => any;
|
|
20
|
+
actions?: WPDataFunctionOrGeneratorArray;
|
|
21
|
+
resolvers?: WPDataFunctionOrGeneratorArray;
|
|
22
|
+
selectors?: WPDataFunctionArray;
|
|
23
|
+
controls?: WPDataFunctionArray;
|
|
24
|
+
}
|
|
25
|
+
export interface WPDataRegistry {
|
|
26
|
+
register: (store: WPDataStore) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface WPDataEmitter {
|
|
29
|
+
emit: () => void;
|
|
30
|
+
subscribe: (listener: () => void) => () => void;
|
|
31
|
+
pause: () => void;
|
|
32
|
+
resume: () => void;
|
|
33
|
+
isPaused: boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,8BAA8B,GAAG,KAAK,CAAE,QAAQ,GAAG,SAAS,CAAE,CAAC;AAC3E,oBAAY,mBAAmB,GAAG,KAAK,CAAE,QAAQ,CAAE,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IACnC,YAAY,EAAE,MAAM,mBAAmB,CAAC;IACxC,UAAU,EAAE,MAAM,mBAAmB,CAAC;IACtC,SAAS,EAAE,CAAE,QAAQ,EAAE,MAAM,IAAI,KAAM,MAAM,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,EAAE,CAAE,QAAQ,EAAE,cAAc,KAAM,mBAAmB,CAAC;CACjE;AAED,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,CAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAM,GAAG,CAAC;IAC5C,OAAO,CAAC,EAAE,8BAA8B,CAAC;IACzC,SAAS,CAAC,EAAE,8BAA8B,CAAC;IAC3C,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,CAAE,KAAK,EAAE,WAAW,KAAM,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,SAAS,EAAE,CAAE,QAAQ,EAAE,MAAM,IAAI,KAAM,MAAM,IAAI,CAAC;IAClD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/data",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.5",
|
|
4
4
|
"description": "Data module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@babel/runtime": "^7.
|
|
31
|
-
"@wordpress/compose": "^5.0.
|
|
32
|
-
"@wordpress/deprecated": "^3.2.
|
|
33
|
-
"@wordpress/element": "^4.0.
|
|
34
|
-
"@wordpress/is-shallow-equal": "^4.2.
|
|
35
|
-
"@wordpress/priority-queue": "^2.2.
|
|
36
|
-
"@wordpress/redux-routine": "^4.2.
|
|
30
|
+
"@babel/runtime": "^7.16.0",
|
|
31
|
+
"@wordpress/compose": "^5.0.7",
|
|
32
|
+
"@wordpress/deprecated": "^3.2.3",
|
|
33
|
+
"@wordpress/element": "^4.0.4",
|
|
34
|
+
"@wordpress/is-shallow-equal": "^4.2.1",
|
|
35
|
+
"@wordpress/priority-queue": "^2.2.3",
|
|
36
|
+
"@wordpress/redux-routine": "^4.2.2",
|
|
37
37
|
"equivalent-key-map": "^0.2.2",
|
|
38
38
|
"is-promise": "^4.0.0",
|
|
39
39
|
"lodash": "^4.17.21",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1081a28b2368fcebd9a14554fbd0e25eb33fbcb6"
|
|
51
51
|
}
|
package/src/redux-store/index.js
CHANGED
|
@@ -26,6 +26,16 @@ import * as metadataActions from './metadata/actions';
|
|
|
26
26
|
/** @typedef {import('../types').WPDataStore} WPDataStore */
|
|
27
27
|
/** @typedef {import('../types').WPDataReduxStoreConfig} WPDataReduxStoreConfig */
|
|
28
28
|
|
|
29
|
+
const trimUndefinedValues = ( array ) => {
|
|
30
|
+
const result = [ ...array ];
|
|
31
|
+
for ( let i = result.length - 1; i >= 0; i-- ) {
|
|
32
|
+
if ( result[ i ] === undefined ) {
|
|
33
|
+
result.splice( i, 1 );
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
|
|
29
39
|
/**
|
|
30
40
|
* Create a cache to track whether resolvers started running or not.
|
|
31
41
|
*
|
|
@@ -35,12 +45,15 @@ function createResolversCache() {
|
|
|
35
45
|
const cache = {};
|
|
36
46
|
return {
|
|
37
47
|
isRunning( selectorName, args ) {
|
|
38
|
-
return
|
|
48
|
+
return (
|
|
49
|
+
cache[ selectorName ] &&
|
|
50
|
+
cache[ selectorName ].get( trimUndefinedValues( args ) )
|
|
51
|
+
);
|
|
39
52
|
},
|
|
40
53
|
|
|
41
54
|
clear( selectorName, args ) {
|
|
42
55
|
if ( cache[ selectorName ] ) {
|
|
43
|
-
cache[ selectorName ].delete( args );
|
|
56
|
+
cache[ selectorName ].delete( trimUndefinedValues( args ) );
|
|
44
57
|
}
|
|
45
58
|
},
|
|
46
59
|
|
|
@@ -49,7 +62,7 @@ function createResolversCache() {
|
|
|
49
62
|
cache[ selectorName ] = new EquivalentKeyMap();
|
|
50
63
|
}
|
|
51
64
|
|
|
52
|
-
cache[ selectorName ].set( args, true );
|
|
65
|
+
cache[ selectorName ].set( trimUndefinedValues( args ), true );
|
|
53
66
|
},
|
|
54
67
|
};
|
|
55
68
|
}
|
|
@@ -324,7 +337,6 @@ function mapResolveSelectors( selectors, store ) {
|
|
|
324
337
|
const hasFinished = () =>
|
|
325
338
|
selectors.hasFinishedResolution( selectorName, args );
|
|
326
339
|
const getResult = () => selector.apply( null, args );
|
|
327
|
-
|
|
328
340
|
// trigger the selector (to trigger the resolver)
|
|
329
341
|
const result = getResult();
|
|
330
342
|
if ( hasFinished() ) {
|
|
@@ -376,6 +388,7 @@ function mapResolvers( resolvers, selectors, store, resolversCache ) {
|
|
|
376
388
|
const selectorResolver = ( ...args ) => {
|
|
377
389
|
async function fulfillSelector() {
|
|
378
390
|
const state = store.getState();
|
|
391
|
+
|
|
379
392
|
if (
|
|
380
393
|
resolversCache.isRunning( selectorName, args ) ||
|
|
381
394
|
( typeof resolver.isFulfilled === 'function' &&
|
|
File without changes
|
package/tsconfig.json
CHANGED
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/redux-store/metadata/actions.js","./src/redux-store/metadata/equivalent-key-map.d.ts","../../node_modules/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","../../node_modules/redux/index.d.ts","./src/redux-store/metadata/utils.js","./src/redux-store/metadata/reducer.ts","./src/redux-store/metadata/selectors.js","../../node_modules/is-promise/index.d.ts","./src/promise-middleware.js","./src/types.d.ts","./src/utils/emitter.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"575681593b7e88e6eb00d5f678393eaa9733e101d02c30a068d3a24a32897460","8eed414bd2305e20163d35205b450204002bf20e14c7241d7fec46bb18f174d2","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},{"version":"d530250769a14518ebd6edda5b5f94abaaf3b9f612363c0da32082fa6acd0da8","affectsGlobalScope":true},"eb299028527009e3de3f323eb1c1f4fcbe8ad0f4ac51caa08844b654d2e8ea98","a0ece1260105335b3dd81d6e16472ecd6e862b30141e287d5eff75ff889e4600","84afb9594b09b54f793629627078ce4ba723cb95055aa5148f1d0cf5be7f4344","5ac6404ddc5d622905e131dbc5da0362a82e89d1cb97cc8256bf06ca9fad4b24","9fcfbc2dd0c0614b3a25d41e4425dd86cdfa574a9e7d2febffc85badcee1a0b8","e5cba7b22ed133413f3734349f4b4c5e85c106ebe6b9ac011ceec3cc39c123ff","2c479b6e0f4fff2a6ca973b6b9f67dd6d0ec075f826bfd478da13360b1d0caf3"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":false,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[47,49,50,51,52,53,54,55,56,57,58,59],[47,48,50,51,52,53,54,55,56,57,58,59],[48,49,50,51,52,53,54,55,56,57,58,59],[47,48,49,51,52,53,54,55,56,57,58,59],[47,48,49,50,52,53,54,55,56,57,58,59],[47,48,49,50,51,53,54,55,56,57,58,59],[47,48,49,50,51,52,54,55,56,57,58,59],[47,48,49,50,51,52,53,55,56,57,58,59],[47,48,49,50,51,52,53,54,56,57,58,59],[47,48,49,50,51,52,53,54,55,57,58,59],[47,48,49,50,51,52,53,54,55,56,58,59],[47,48,49,50,51,52,53,54,55,56,57,59],[47,48,49,50,51,52,53,54,55,56,57,58],[60,64],[45,46,59,60,61],[59,62],[60],[66]],"referencedMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[65,14],[62,15],[63,16],[61,17],[67,18]],"exportedModulesMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[65,14],[62,15],[63,16],[61,17],[67,18]],"semanticDiagnosticsPerFile":[48,49,47,50,51,52,53,54,55,56,57,58,59,64,60,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,65,45,46,62,63,61,66,67]},"version":"4.4.2"}
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/redux-store/metadata/actions.js","./src/redux-store/metadata/equivalent-key-map.d.ts","../../node_modules/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","../../node_modules/redux/index.d.ts","./src/redux-store/metadata/utils.js","./src/redux-store/metadata/reducer.ts","./src/redux-store/metadata/selectors.js","../../node_modules/is-promise/index.d.ts","./src/promise-middleware.js","./src/types.ts","./src/utils/emitter.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"575681593b7e88e6eb00d5f678393eaa9733e101d02c30a068d3a24a32897460","8eed414bd2305e20163d35205b450204002bf20e14c7241d7fec46bb18f174d2","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},{"version":"d530250769a14518ebd6edda5b5f94abaaf3b9f612363c0da32082fa6acd0da8","affectsGlobalScope":true},"eb299028527009e3de3f323eb1c1f4fcbe8ad0f4ac51caa08844b654d2e8ea98","a0ece1260105335b3dd81d6e16472ecd6e862b30141e287d5eff75ff889e4600","84afb9594b09b54f793629627078ce4ba723cb95055aa5148f1d0cf5be7f4344","5ac6404ddc5d622905e131dbc5da0362a82e89d1cb97cc8256bf06ca9fad4b24","9fcfbc2dd0c0614b3a25d41e4425dd86cdfa574a9e7d2febffc85badcee1a0b8","e5cba7b22ed133413f3734349f4b4c5e85c106ebe6b9ac011ceec3cc39c123ff","2c479b6e0f4fff2a6ca973b6b9f67dd6d0ec075f826bfd478da13360b1d0caf3"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":false,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[47,49,50,51,52,53,54,55,56,57,58,59],[47,48,50,51,52,53,54,55,56,57,58,59],[48,49,50,51,52,53,54,55,56,57,58,59],[47,48,49,51,52,53,54,55,56,57,58,59],[47,48,49,50,52,53,54,55,56,57,58,59],[47,48,49,50,51,53,54,55,56,57,58,59],[47,48,49,50,51,52,54,55,56,57,58,59],[47,48,49,50,51,52,53,55,56,57,58,59],[47,48,49,50,51,52,53,54,56,57,58,59],[47,48,49,50,51,52,53,54,55,57,58,59],[47,48,49,50,51,52,53,54,55,56,58,59],[47,48,49,50,51,52,53,54,55,56,57,59],[47,48,49,50,51,52,53,54,55,56,57,58],[60,64],[45,46,59,60,61],[59,62],[60],[66]],"referencedMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[65,14],[62,15],[63,16],[61,17],[67,18]],"exportedModulesMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[65,14],[62,15],[63,16],[61,17],[67,18]],"semanticDiagnosticsPerFile":[48,49,47,50,51,52,53,54,55,56,57,58,59,64,60,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,65,45,46,62,63,61,66,67]},"version":"4.4.2"}
|
package/build/types.d.js
DELETED
package/build-module/types.d.js
DELETED