Skip to content

Move shared Events stuff out of React.Basic.DOM #26

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

Merged
merged 5 commits into from
Mar 28, 2018

Conversation

maddie927
Copy link
Member

This makes the EventFn constructor public (downside) but decouples the event stuff that isn't dom specific from the dom modules so they can be reused (upside).

@maddie927 maddie927 self-assigned this Mar 28, 2018
@maddie927 maddie927 changed the title Michael/split non dom event stuff Move shared Events stuff out of React.Basic.DOM Mar 28, 2018
@paf31
Copy link
Contributor

paf31 commented Mar 28, 2018

I don't think we should expose the constructor. If we have to expose something, it should be a smart constructor with unsafe in the name.

@maddie927
Copy link
Member Author

Ah, good idea

unsafeEventFn :: forall a b. (a -> b) -> EventFn a b
```

Unsafely create an `EventFn`. This function should be avoided.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth commenting briefly on why this function is dangerous (it lets SyntheticEvents leave the current scope). Otherwise, this PR looks good to me 👍

@maddie927 maddie927 merged commit 4e7071d into master Mar 28, 2018
@maddie927 maddie927 deleted the michael/split-non-dom-event-stuff branch March 28, 2018 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants