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

Commit

Permalink
Merge pull request #133 from coot/popstate-event
Browse files Browse the repository at this point in the history
Added PopStateEvent
  • Loading branch information
garyb authored Nov 12, 2017
2 parents e9b48d5 + 975a2f9 commit c7669b6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/DOM/Event/PopstateEvent.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module DOM.Event.PopstateEvent
( eventToPopStateEvent
) where

import DOM.Event.Types (Event, PopStateEvent, readPopStateEvent)
import Data.Foreign (F, toForeign)
import Prelude ((<<<))

eventToPopStateEvent :: Event -> F PopStateEvent
eventToPopStateEvent = readPopStateEvent <<< toForeign
11 changes: 11 additions & 0 deletions src/DOM/Event/Types.purs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ module DOM.Event.Types
, CompositionEvent
, compositionEventToEvent
, readCompositionEvent
, PopStateEvent
, popStateEventToEvent
, readPopStateEvent
, ProgressEvent
, progressEventToEvent
, readProgressEvent
Expand Down Expand Up @@ -141,6 +144,14 @@ compositionEventToEvent = U.unsafeCoerce
readCompositionEvent :: Foreign -> F CompositionEvent
readCompositionEvent = unsafeReadTagged "CompositionEvent"

foreign import data PopStateEvent :: Type

popStateEventToEvent :: PopStateEvent -> Event
popStateEventToEvent = U.unsafeCoerce

readPopStateEvent :: Foreign -> F PopStateEvent
readPopStateEvent = unsafeReadTagged "PopStateEvent"

foreign import data ProgressEvent :: Type

progressEventToEvent :: ProgressEvent -> Event
Expand Down

0 comments on commit c7669b6

Please sign in to comment.