-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #6 - Requires `Action` instead of `ActionType` as a generic parameter of `ReComponent` and `RePureComponent` - makes sure the type of the `action.payload` is preserved throughout the component's API and reducer Unfortunately, in order to ensure proper type-checking I had to remove `createSender` API. I simply didn't manage to come up with typing that would ensure the correct `payload` typing, while maintaining the same API of `createSender`. Please let me know if you see a solution for it. Even though it has to be removed, I don't think it would make the ergonomics of `ReComponent` significantly worse: ```js this.handleClick = this.createSender("CLICK"); ``` becomes ```js this.handleClick = () => this.send({ type: "CLICK" }); ``` or ```js this.handleClick = (clicks: number) => this.send({ type: "CLICK", payload: clicks }); ``` NOTE: I did not fix documentation (remove all mentions of `createSender` and fix the examples) yet. I would like to wait for the code review first just to know if you are OK with this breaking change. If you decide to proceed with these changes I will make sure the docs are updated as well
- Loading branch information
1 parent
e6eb7de
commit ef07fe9
Showing
7 changed files
with
148 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.