diff --git a/packages/core-data/src/types.ts b/packages/core-data/src/types.ts new file mode 100644 index 0000000000000..b1664d8ab8dbf --- /dev/null +++ b/packages/core-data/src/types.ts @@ -0,0 +1,3 @@ +export interface AnyFunction { + ( ...args: any[] ): any; +} diff --git a/packages/core-data/src/utils/on-sub-key.js b/packages/core-data/src/utils/on-sub-key.js index 24adf06b773eb..c867187f822c3 100644 --- a/packages/core-data/src/utils/on-sub-key.js +++ b/packages/core-data/src/utils/on-sub-key.js @@ -1,10 +1,12 @@ +/** @typedef {import('../types').AnyFunction} AnyFunction */ + /** * Higher-order reducer creator which creates a combined reducer object, keyed * by a property on the action object. * * @param {string} actionProperty Action property by which to key object. * - * @return {Function} Higher-order reducer. + * @return {AnyFunction} Higher-order reducer. */ export const onSubKey = ( actionProperty ) => ( reducer ) => ( state = {},