-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add uncurried hooks #551
Merged
Merged
Add uncurried hooks #551
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
49dab95
Add uncurried hooks
johnridesabike 6c2f27f
Merge branch 'master' into uncurried-hooks
johnridesabike 6fde558
added [@bs.uncurry] to useReducer
johnridesabike 0d19f0d
Merge branch 'master' into uncurried-hooks
peterpme e6bba61
Merge branch 'master' into uncurried-hooks
peterpme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure you want to do all of the
callback
type returns as well = https://reasonml.github.io/try?rrjsx=true&reason=C4TwDgpgBAxghgGwQIzjA1gCgOQEsA0U2A9gJRQC8RulAfEcQNwBQzA2gALIDOAdALbEAJgFcE0AEQAnCGmASAusyhQIAD2AQpAO0RQR3CAGFEKNOgBcylVEycevEdpgipUkAtt5tYEcDoMfr7ApOQU9PBIqBg4uD5+hCRBfmHWKhIGxqbR6BIszOL+AGbExJS2YfQA3gUQ-obARsRO-lSZJlHmmJiVUAAMpCwNTS09LAC+jEAThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the
Uncurried.useCallback*
functions should return typeUncurried.callback
, defined astype callback('input, 'output) = (. 'input) => 'output;
https://reasonml.github.io/try?rrjsx=true&reason=C4TwDgpgBAxghgGwQIzjA1gCgOQEsB2YArsADRTYD2JxwAlFALxSYB0FBtDjAfBdcFoBuAFAiA2gAFkAZ1YBbSgBMiCaACIAThDTB1AXREQAHsAib8iKERkQAwohRp0ALhFQWU2ayL4YRTU0QfRY8QhImPioaEjpuPngkVAwcThJyaMFYpncodRt7R2T0dVERNWAoADNKSiYWeKgAb1yKqFtgO2p8SuYChyTnTDhIqBGAaigARjpRDw6u32A2KAAGWZEAX1EgA
However I did just discover another bug. It doesn’t look like Reason is good at handling arity-zero uncurried functions. I’m not sure what the best way around that is, unless I’m missing something.
https://reasonml.github.io/try?rrjsx=true&reason=C4TwDgpgBAxghgGwQIzjA1gCgOQEsB2YArsADRTYD2JxwAlFALxSYB0FBtDjAfBdcFoBuAFAiA2gAFkAZ1YBbSgBMiCaACIAThDTB1AXREQAHsAib8iKERkQAwohRp0ALhFQWU2ayL4YRTU0QfRY8QhImPioaEjpuPngkVAwcThJyaMFYpncodRt7R2T0dVERNWAoADNKSiYWeKgAb1yKqFtgO2p8SuYChyTnTExGgAY6UQ8Ort9gNgmRAF9RIA
Seems to be related to reasonml/reason#2357
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I was oblivious. Good call for keeping continuity with the other set.
Yah that issue provides a workaround but it is kind of annoying that this error exists. I don't think it should block this PR though - if the feature is never used then a better experience won't be prioritized.