Skip to content

Commit 0a6294a

Browse files
committed
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] microsoft/TypeScript#45483
1 parent a95447b commit 0a6294a

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/sidebar/store/create-store.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,6 @@ import { createReducer, bindSelectors } from './util';
5757
* @prop {RootSelectors} [rootSelectors]
5858
*/
5959

60-
/**
61-
* Replace a type `T` with `Fallback` if `T` is `any`.
62-
*
63-
* Based on https://stackoverflow.com/a/61626123/434243.
64-
*
65-
* @template T
66-
* @template Fallback
67-
* @typedef {0 extends (1 & T) ? Fallback : T} DefaultIfAny
68-
*/
69-
7060
/**
7161
* Helper for getting the type of store produced by `createStore` when
7262
* passed a given module.
@@ -77,7 +67,7 @@ import { createReducer, bindSelectors } from './util';
7767
*
7868
* @template T
7969
* @typedef {T extends Module<any, infer Actions, infer Selectors, infer RootSelectors> ?
80-
* Store<Actions,Selectors,DefaultIfAny<RootSelectors,{}>> : never} StoreFromModule
70+
* Store<Actions,Selectors,RootSelectors> : never} StoreFromModule
8171
*/
8272

8373
/**
@@ -196,7 +186,7 @@ export function createStore(modules, initArgs = [], middleware = []) {
196186
* @template State
197187
* @template Actions
198188
* @template {SelectorMap<State>} Selectors
199-
* @template RootSelectors
189+
* @template [RootSelectors={}]
200190
* @param {State | ((...args: any[]) => State)} initialState
201191
* @param {object} config
202192
* @param {string} config.namespace -

0 commit comments

Comments
 (0)