How do I get the current browser URL with purescript?

73 views Asked by At

How do I get the the browser URL in Purescript, just like when doing window.location.href in javascript?

1

There are 1 answers

0
Chris Stryczynski On BEST ANSWER
import Web.HTML (window)
import Web.HTML.Window (location)
import Web.HTML.Location (pathname)
import Effect.Console (log)



main :: Effect Unit
main = do
  l <- window >>= location >>= pathname
  log $ l