-
Notifications
You must be signed in to change notification settings - Fork 37
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 module functor to make CustomEvent with typed detail #93
Conversation
Interesting. I hadn't considered doing it this way. I'll give it some thought, thanks! |
0de7ecd
to
74c8e73
Compare
committed the suggestions and fix the test. |
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.
Looks good! I wonder whether we should delete the non-functor version in our v2 API update 😂
let t: Detail.t = { | ||
test: "test", | ||
} |
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.
Can this be done without the let t
? I'm looking at the generated JS and it would be nice to avoid that part.
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.
I guess you mentioned this generated js part
var t = {
test: "test"
};
I'm afraid that the omission of this let t
can't be made unless we change the test case to make
instead of makeWithOption
. or renaming the let t
would be nicer such as let option
maybe?
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.
But why does it need to be separate let
? It's just a simple record, can't it be EventWithDetail.makeWithOptions("event-with-detail", { test: "test" })
?
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 misunderstood your intention. I removed it and pushed it.
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.
There was two of them - sorry, please make that change to both :)
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.
Ah! I missed that, thx. I fixed it and pushed it. I reworded commit messages also.
Co-authored-by: spocke <[email protected]>
Co-authored-by: spocke <[email protected]>
cabe968
to
f620b55
Compare
@TheSpyder I don't know why exactly, but does my rebase to reword the commits cause the task-list-complete check running loop maybe? |
No, it's because resolving a comment thread doesn't automatically resolve all tasks within it: I normally take care of that before merging if it's clear the task was done. I hope to find time to finish reviewing and merge this in the next day or two. |
@TheSpyder I got it. Thx. |
published as 0.6.1 |
This PR is related to reasonml-community/bs-webapi-incubator#204, reasonml-community/bs-webapi-incubator#203.
This PR adds a module functor to make a
CustomEvent
module with typed detail.Example