Module

Prospero.Subscription

Package
purescript-prospero
Repository
rowtype-yoga/purescript-prospero

#EventSource Source

newtype EventSource a

An EventSource emits values to subscribers.

#mkEventSource Source

mkEventSource :: forall a m. MonadEffect m => m (EventSource a)

Create a new EventSource.

#emit Source

emit :: forall a m. MonadEffect m => EventSource a -> a -> m Unit

Emit a value to all current subscribers.

#subscribe Source

subscribe :: forall a m. MonadEffect m => EventSource a -> (a -> Effect Unit) -> m (Effect Unit)

Subscribe to an EventSource. Returns an unsubscribe effect.