Skip to content

Commit 6e26229

Browse files
committed
Update for changes in EventTypes
1 parent 0f56271 commit 6e26229

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Routing/Hash.purs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ module Routing.Hash
1111

1212
import Prelude
1313

14+
import Data.Foldable (class Foldable, indexl)
15+
import Data.Maybe (Maybe(..), fromMaybe, maybe)
16+
import Data.String (Pattern(..), stripPrefix)
1417
import Effect (Effect)
1518
import Effect.Ref as Ref
19+
import Routing (match, matchWith)
20+
import Routing.Match (Match)
1621
import Web.Event.EventTarget (addEventListener, eventListener, removeEventListener)
1722
import Web.HTML (window)
23+
import Web.HTML.Event.HashChangeEvent.EventTypes as ET
1824
import Web.HTML.Location as L
1925
import Web.HTML.Window as Window
20-
import Web.HTML.Window.EventTypes as WET
21-
import Data.Foldable (class Foldable, indexl)
22-
import Data.Maybe (Maybe(..), fromMaybe, maybe)
23-
import Data.String (Pattern(..), stripPrefix)
24-
import Routing (match, matchWith)
25-
import Routing.Match (Match)
2626

2727
-- | Gets the global location hash.
2828
getHash :: Effect String
@@ -48,8 +48,8 @@ foldHashes cb init = do
4848
ref <- Ref.new =<< init =<< getHash
4949
win <- Window.toEventTarget <$> window
5050
listener <- eventListener \_ -> flip Ref.write ref =<< join (cb <$> Ref.read ref <*> getHash)
51-
addEventListener WET.hashchange listener false win
52-
pure $ removeEventListener WET.hashchange listener false win
51+
addEventListener ET.hashchange listener false win
52+
pure $ removeEventListener ET.hashchange listener false win
5353

5454
-- | Runs the callback on every hash change providing the previous hash and the
5555
-- | latest hash. The provided String is the hash portion of the `Location` with

src/Routing/PushState.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ import Web.DOM.Node (setNodeValue) as DOM
2727
import Web.DOM.Text as Text
2828
import Web.Event.EventTarget (addEventListener, eventListener) as DOM
2929
import Web.HTML (window) as DOM
30+
import Web.HTML.Event.PopStateEvent.EventTypes as ET
3031
import Web.HTML.HTMLDocument as HTMLDocument
3132
import Web.HTML.History as History
3233
import Web.HTML.Location (hash, pathname, search) as DOM
3334
import Web.HTML.Window as Window
34-
import Web.HTML.Window.EventTypes as WET
3535

3636
-- | A `PushStateInterface` is a localized instance for making location changes
3737
-- | and consuming the events. Since the DOM API does not provide a general
@@ -102,7 +102,7 @@ makeInterface = do
102102

103103
DOM.window
104104
>>= Window.toEventTarget
105-
>>> DOM.addEventListener WET.popstate listener false
105+
>>> DOM.addEventListener ET.popstate listener false
106106

107107
pure
108108
{ pushState: stateFn History.pushState

0 commit comments

Comments
 (0)