• Robert Knight's avatar
    Specify type of `state` arguments to `createSelector` calls · 7bc88d9c
    Robert Knight authored
    The newest version of the `createSelector` typings require the type of
    the input argument to be determined in order for the whole call to
    typecheck. This commit implements a pattern where:
    
    - A `State` type is added in various store modules, typically defined as
      `typeof initialState`, that defines the state of that store module's
      type.
    - The type of selector function params in `createSelector` calls is
      specified with `@param {State} state` and the return type is inferred
    
    The upside of these changes is that types of selector functions are
    determined much more robustly - previously it was possible to have
    incorrect types specified via JSDoc.
    
    In the process an existing minor bug was determined where an
    `isHighlight` call in `ThreadList` was passed an unexpected type of
    object (the `annotation` property of a `Draft`) for which `isHighlight`
    did not crash but would always return false. I have simply suppressed
    this existing issue for the moment, but it will need to be fixed
    separately.
    7bc88d9c
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
requirements Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.mjs Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
rollup-boot.config.mjs Loading commit data...
rollup-tests.config.mjs Loading commit data...
rollup.config.mjs Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...