Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Added PopStateEvent #133

Merged
merged 2 commits into from
Nov 12, 2017
Merged

Conversation

coot
Copy link
Contributor

@coot coot commented Nov 7, 2017

This adds PopStateEvent which is in HTML5 spec.

There is no way of creating events, is this on purpose, or would you accept a PR which adds methods to create events?

@coot
Copy link
Contributor Author

coot commented Nov 7, 2017

It would be nice to also include support for PopStateEvent.state property. I think we should reflect state type on the type level with:

foreign import data PopStateEvent :: Type -> Type

Would that be fine?

@garyb
Copy link
Member

garyb commented Nov 12, 2017

The missing create event functions are not for any particular reason, they're just missing 😉

I don't think we can do that unfortunately with the state type coming from PopStateEvent, since there's no way we can guarantee that the event is carrying state of the type we expect - we can do that when creating an event, but when it arrives from the DOM we'd just be unsafeCoerceing it pretty much.

@garyb garyb merged commit c7669b6 into purescript-deprecated:master Nov 12, 2017
@coot coot deleted the popstate-event branch November 12, 2017 22:52
@coot
Copy link
Contributor Author

coot commented Nov 12, 2017

You're right. At least we can add readState :: forall eff. PopStateEvent -> Eff (dom :: DOM | eff) Foreign.

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.

2 participants