Module

FRP.Event.Legacy

Package
purescript-hyrule
Repository
mikesol/purescript-hyrule

#Event Source

newtype Event a

This is the same as FRP.Event but with a (somewhat questionable) Apply and Applicative instance.

Constructors

Instances

#subscribe Source

subscribe :: forall a. Event a -> (a -> Effect Unit) -> Effect (Effect Unit)

Subscribe to an Event by providing a callback.

subscribe returns a canceller function.

#makeEvent Source

makeEvent :: forall a. ((a -> Effect Unit) -> Effect (Effect Unit)) -> Event a

Make an Event from a function which accepts a callback and returns an unsubscription function.

Note: you probably want to use create instead, unless you need explicit control over unsubscription.

#EventIO Source

type EventIO a = { event :: Event a, push :: a -> Effect Unit }

#create Source

create :: forall a. Effect (EventIO a)

Create an event and a function which supplies a value to that event.