@@ -9,17 +9,16 @@ module Routing (
9
9
matchesAff'
10
10
) where
11
11
12
- import Prelude (Unit , unit , pure , const , ($))
13
- import Control.Monad.Eff (Eff ())
14
- import Control.Monad.Aff (Aff (), makeAff )
15
- import Data.Maybe (Maybe (..))
12
+ import Control.Monad.Aff (Aff , makeAff , nonCanceler )
13
+ import Control.Monad.Eff (Eff )
16
14
import Data.Either (Either (..), either )
17
- import Data.Tuple ( Tuple (..))
15
+ import Data.Maybe ( Maybe (..))
18
16
import Data.String.Regex as R
19
17
import Data.String.Regex.Flags as RF
20
-
21
- import Routing.Parser ( parse )
18
+ import Data.Tuple ( Tuple (..))
19
+ import Prelude ( Unit , const , pure , unit , ($), (<$) )
22
20
import Routing.Match (Match , runMatch )
21
+ import Routing.Parser (parse )
23
22
24
23
25
24
foreign import decodeURIComponent :: String -> String
@@ -53,9 +52,9 @@ matches' decoder routing cb = hashes $ \old new ->
53
52
matchesAff' :: forall e a . (String -> String ) ->
54
53
Match a -> Aff e (Tuple (Maybe a ) a )
55
54
matchesAff' decoder routing =
56
- makeAff \_ k -> do
55
+ makeAff \k -> nonCanceler <$
57
56
matches' decoder routing \old new ->
58
- k $ Tuple old new
57
+ k $ Right $ Tuple old new
59
58
60
59
matchesAff :: forall e a . Match a -> Aff e (Tuple (Maybe a ) a )
61
60
matchesAff = matchesAff' decodeURIComponent
0 commit comments