Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Conversation

@tianzhich
Copy link
Collaborator

  1. Simplify the ExtractRematchDispatcherFromReducer type alias.
  2. Make the Inference of the optional payload (and meta) correctly.

@tianzhich tianzhich requested a review from semoal May 25, 2021 04:31
@github-actions
Copy link

github-actions bot commented May 25, 2021

size-limit report 📦

Path Size
./packages/core/dist/core.umd.production.min.js 1.42 KB (0%)
./packages/immer/dist/immer.umd.production.min.js 143 B (0%)
./packages/loading/dist/loading.umd.production.min.js 596 B (0%)
./packages/persist/dist/persist.umd.production.min.js 172 B (0%)
./packages/select/dist/select.umd.production.min.js 456 B (0%)
./packages/updated/dist/updated.umd.production.min.js 407 B (0%)

@tianzhich tianzhich linked an issue May 25, 2021 that may be closed by this pull request
@semoal
Copy link
Member

semoal commented May 25, 2021

Looks good mate, nice refactor :)

I've created a file called packages/core/test/ts_typings/dispatcher-typings.test.ts, to create tests of our typings related to dispatch, basically consists:

  • Reducers
    • With optional payload
    • With required payload
  • Effects
    • With optional payload
    • With required payload
    • With optional payload and rootState
    • With required payload and required rootstate

and saw that effects with optional payload was not working properly, take a look to this pr mate: #902

@tianzhich tianzhich changed the base branch from main to improve-typing May 26, 2021 12:08
@tianzhich tianzhich merged commit 78351ce into improve-typing May 26, 2021
semoal added a commit that referenced this pull request Jun 10, 2021
* fix: optional payload inference

* fix: optional payload inference inside effects (#902)

Co-authored-by: tianzhich <[email protected]>

Co-authored-by: Sergio Moreno <[email protected]>
@semoal semoal deleted the fix-type-inference branch July 5, 2021 15:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Typescript dispatch reducers inference

3 participants