From 0a6294a9675e622acf6c21955fcf430631698869 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Thu, 24 Mar 2022 13:31:05 +0000 Subject: [PATCH] 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 --- src/sidebar/store/create-store.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/sidebar/store/create-store.js b/src/sidebar/store/create-store.js index 5910f4e9a09..1fd203eb909 100644 --- a/src/sidebar/store/create-store.js +++ b/src/sidebar/store/create-store.js @@ -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 ? - * Store> : never} StoreFromModule + * Store : never} StoreFromModule */ /** @@ -196,7 +186,7 @@ export function createStore(modules, initArgs = [], middleware = []) { * @template State * @template Actions * @template {SelectorMap} Selectors - * @template RootSelectors + * @template [RootSelectors={}] * @param {State | ((...args: any[]) => State)} initialState * @param {object} config * @param {string} config.namespace -