Module

Specular.FRP.WeakDynamic

Package
purescript-specular
Repository
restaumatic/purescript-specular

#WeakDynamic Source

newtype WeakDynamic a

A primitive similar to Dynamic. The difference is: while Dynamic always has a value, WeakDynamic has a value always after some point, but for some time after construction it may be without value.

A Dynamic can be always converted to a WeakDynamic using weaken.

Instances

#unWeakDynamic Source

unWeakDynamic :: forall a. WeakDynamic a -> Dynamic (Maybe a)

#changedW Source

changedW :: forall a. WeakDynamic a -> Event a

An Event that fires every time a WeakDynamic changes, with the new value.

#weaken Source

weaken :: forall a. Dynamic a -> WeakDynamic a

Convert a Dynamic to a WeakDynamic. It will have the same value as the original Dynamic, and will change whenever the original Dynamic changes.

#holdWeakDyn Source

holdWeakDyn :: forall m a. MonadFRP m => Event a -> m (WeakDynamic a)

Make a WeakDynamic that will have no value, but will acquire one when the Event fires. It will also change every time the Event fires.

#switchWeakDyn Source

switchWeakDyn :: forall a. WeakDynamic (Event a) -> Event a

Make an Event that occurs when the given WeakDynamic has a value, and the value (an Event) occurs.

#subscribeWeakDyn Source

subscribeWeakDyn :: forall m a b. MonadFRP m => (a -> Effect b) -> WeakDynamic a -> m (WeakDynamic b)

Invoke the handler immediately if the WeakDynamic has a value currently, and invoke it every time it changes, until cleanup.

#subscribeWeakDyn_ Source

subscribeWeakDyn_ :: forall m a. MonadFRP m => (a -> Effect Unit) -> WeakDynamic a -> m Unit

Invoke the handler immediately if the WeakDynamic has a value currently, and invoke it every time it changes, until cleanup.

#attachWeakDynWith Source

attachWeakDynWith :: forall a b c. (a -> b -> c) -> WeakDynamic a -> Event b -> Event c

#tagWeakDyn Source

tagWeakDyn :: forall a. WeakDynamic a -> Event Unit -> Event a

#uniqWeakDynBy Source

uniqWeakDynBy :: forall m a. MonadFRP m => (a -> a -> Boolean) -> WeakDynamic a -> m (WeakDynamic a)

Make a WeakDynamic that only changes value when the input WeakDynamic changes value, and the new value is not equal to the previous value with respect to the given equality test.