Routing.Hash
- Package
- purescript-routing
- Repository
- slamdata/purescript-routing
#foldHashes Source
foldHashes :: forall a. (a -> String -> Effect a) -> (String -> Effect a) -> Effect (Effect Unit)
Folds effectfully over hash changes given a callback and an initial hash.
The provided String is the hash portion of the Location
with the '#'
prefix stripped. Returns an effect which will remove the listener.
#matches Source
matches :: forall a. Match a -> (Maybe a -> a -> Effect Unit) -> Effect (Effect Unit)
Runs the callback on every hash change using a given Match
parser to
extract a route from the hash. If a hash fails to parse, it is ignored.
To avoid dropping hashes, provide a fallback alternative in your parser.
Returns an effect which will remove the listener.
#matchesWith Source
matchesWith :: forall a f. Foldable f => (String -> f a) -> (Maybe a -> a -> Effect Unit) -> Effect (Effect Unit)
Runs the callback on every hash change using a given custom parser to extract a route from the hash. If a hash fails to parse, it is ignored. To avoid dropping hashes, provide a fallback alternative in your parser. Returns an effect which will remove the listener.