• 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
..
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...