• Robert Knight's avatar
    Extract `initialState` property into a separate argument · a1183565
    Robert Knight authored
    Extract the `initialState` property out of the `config` object passed
    to `createStoreModule` into a separate argument which is passed before
    `config`. This allows TypeScript to infer the type of fields/parameters
    etc. which refer to the module state while processing the `config`
    argument.
    
    For example, given the following:
    
    ```
    export default createStoreModule(initialState, {
      reducers: {
        updateThing(state, action) {
          ...
        }
      }
    });
    ```
    
    TS can infer the type of the `state` argument to `updateThing` without
    needing to explicitly annotate it. The same approach can work for other
    fields as well. This inference does not work when `initialState` is a
    property of the `config` object however.
    a1183565
Name
Last commit
Last update
..
test Loading commit data...
activity.js Loading commit data...
annotations.js Loading commit data...
defaults.js Loading commit data...
direct-linked.js Loading commit data...
drafts.js Loading commit data...
filters.js Loading commit data...
frames.js Loading commit data...
groups.js Loading commit data...
links.js Loading commit data...
real-time-updates.js Loading commit data...
route.js Loading commit data...
selection.js Loading commit data...
session.js Loading commit data...
sidebar-panels.js Loading commit data...
toast-messages.js Loading commit data...
viewer.js Loading commit data...