Commit 788697ec authored by Robert Knight's avatar Robert Knight

Remove `DefaultIfAny` helper

Remove a cryptic piece of code that is no longer needed given the ability to
specify default values for template arguments [1]

[1] https://github.com/microsoft/TypeScript/pull/45483
parent a95447b1
......@@ -57,16 +57,6 @@ import { createReducer, bindSelectors } from './util';
* @prop {RootSelectors} [rootSelectors]
*/
/**
* Replace a type `T` with `Fallback` if `T` is `any`.
*
* Based on https://stackoverflow.com/a/61626123/434243.
*
* @template T
* @template Fallback
* @typedef {0 extends (1 & T) ? Fallback : T} DefaultIfAny
*/
/**
* Helper for getting the type of store produced by `createStore` when
* passed a given module.
......@@ -77,7 +67,7 @@ import { createReducer, bindSelectors } from './util';
*
* @template T
* @typedef {T extends Module<any, infer Actions, infer Selectors, infer RootSelectors> ?
* Store<Actions,Selectors,DefaultIfAny<RootSelectors,{}>> : never} StoreFromModule
* Store<Actions,Selectors,RootSelectors> : never} StoreFromModule
*/
/**
......@@ -196,7 +186,7 @@ export function createStore(modules, initArgs = [], middleware = []) {
* @template State
* @template Actions
* @template {SelectorMap<State>} Selectors
* @template RootSelectors
* @template [RootSelectors={}]
* @param {State | ((...args: any[]) => State)} initialState
* @param {object} config
* @param {string} config.namespace -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment