Module

Specular.Ref

Package
purescript-specular
Repository
restaumatic/purescript-specular

#Ref Source

data Ref a

Constructors

Instances

#newRef Source

newRef :: forall a m. MonadEffect m => a -> m (Ref a)

Old name for new.

#new Source

new :: forall a m. MonadEffect m => a -> m (Ref a)

Create a new Ref with an initial value.

#newRefWithEvent Source

newRefWithEvent :: forall a m. MonadFRP m => a -> Event (a -> a) -> m (Ref a)

#value Source

value :: forall a. Ref a -> Dynamic a

The current value of the Ref, as a Dynamic.

#modify Source

modify :: forall a. Ref a -> (a -> a) -> Effect Unit

A Callback to modify value of this Ref using a function.

#refUpdateConst Source

refUpdateConst :: forall a. Ref a -> a -> Effect Unit

Old name for set.

#set Source

set :: forall a. Ref a -> a -> Effect Unit

A Callback to overwrite value of this Ref.

#focusRef Source

focusRef :: forall a s. Dynamic (Lens s a) -> Ref s -> Ref a

#pureFocusRef Source

pureFocusRef :: forall a s. Lens s a -> Ref s -> Ref a

#previewRef Source

previewRef :: forall a s. Prism s a -> Ref s -> Ref (Maybe a)

#readRef Source

readRef :: forall a m. MonadEffect m => Ref a -> m a

#constRef Source

constRef :: forall a. a -> Ref a

#wrapViewWidget Source

wrapViewWidget :: forall a m. MonadWidget m => (WeakDynamic a -> m (Event a)) -> Ref a -> m Unit

#Lens Source

type Lens s a = { get :: s -> a, set :: s -> a -> s }

#Prism Source

type Prism s a = { preview :: s -> Maybe a, review :: a -> s }

#updateRef Source

updateRef :: forall a. Ref a -> a -> Effect Unit

#refValue Source

refValue :: forall a. Ref a -> Dynamic a

Old name for value

#refUpdate Source

refUpdate :: forall a. Ref a -> (a -> a) -> Effect Unit

Old name for modify.