How do I import in GHCJS a Javascript function like the following ?
xs.subscribe(function(x) { console.log(x) })
I tried various combinations of the following without success:
data Observable_
data Disposable_
type Observable a = JSRef Observable_
type Disposable = JSRef ()
foreign import javascript unsafe "$1.subscribe($2)"
rx_subscribe :: Observable a -> JSRef (a -> IO()) -> IO Disposable
Any help is appreciated, and links to documentation of the GHCJS FFI.
Thanks