• Robert Knight's avatar
    Improve type of `selectors` map · 4fd547b3
    Robert Knight authored
    Improve the type of the `selectors` argument to `createStoreModule` to
    link it to the type of the initial state returned by the `initialState`
    argument. This enables TS to check/infer that the first argument to
    these functions should be of the same type that `initialState` returns.
    
    In the process it was necessary to remove the `ModuleConfig` type and
    declare the type of `createStoreModule`'s `config` argument inline.
    This works around a TypeScript limitation [1]:
    
    ```
    @template State
    @template {SelectorMap<State>} Selectors // Unexpected error
    ...
    @typedef ModuleConfig
    ```
    
    But this works:
    
    ``
    @template State
    @template {SelectorMap<State>} Selectors // OK
    ...
    function createStoreModule(...) { ... }
    ```
    
    [1] https://github.com/microsoft/TypeScript/issues/43403
    4fd547b3
Name
Last commit
Last update
..
components Loading commit data...
config Loading commit data...
helpers Loading commit data...
services Loading commit data...
store Loading commit data...
test Loading commit data...
util Loading commit data...
cross-origin-rpc.js Loading commit data...
icons.js Loading commit data...
index.js Loading commit data...
markdown-commands.js Loading commit data...
media-embedder.js Loading commit data...
render-markdown.js Loading commit data...
search-client.js Loading commit data...
service-context.js Loading commit data...
websocket.js Loading commit data...