Module

Specular.FRP.List

Package
purescript-specular
Repository
restaumatic/purescript-specular

#dynamicListWithIndex Source

dynamicListWithIndex :: forall m a b. MonadFRP m => MonadReplace m => Dynamic (Array a) -> (Int -> Dynamic a -> m b) -> m (Dynamic (Array b))

dynamicListWithIndex dynArray handler Render a list of items from dynArray. Each item will be rendered by handler.

When the array changes, indexes that exist in both old and new array are updated, e.g. the Dynamics passed to handlers are changed. As an optimization, when old and new item values are the same JS object (using ===), the Dynamic is not updated.

If the array grows (a new index appears), a new handler is invoked.

The resulting Dynamic represents return values from all the handlers.

#dynamicList Source

dynamicList :: forall m a b. MonadFRP m => MonadReplace m => Dynamic (Array a) -> (Dynamic a -> m b) -> m (Dynamic (Array b))

#dynamicListWithIndex_ Source

dynamicListWithIndex_ :: forall m a. MonadFRP m => MonadReplace m => Dynamic (Array a) -> (Int -> Dynamic a -> m Unit) -> m Unit

#dynamicList_ Source

dynamicList_ :: forall m a. MonadFRP m => MonadReplace m => Dynamic (Array a) -> (Dynamic a -> m Unit) -> m Unit

#weakDynamicListWithIndex Source

weakDynamicListWithIndex :: forall m a b. MonadFRP m => MonadReplace m => WeakDynamic (Array a) -> (Int -> WeakDynamic a -> m b) -> m (WeakDynamic (Array b))

Like listWithIndex, but operates on WeakDynamics.

#weakDynamicList Source

weakDynamicList :: forall m a b. MonadFRP m => MonadReplace m => WeakDynamic (Array a) -> (WeakDynamic a -> m b) -> m (WeakDynamic (Array b))

#weakDynamicListWithIndex_ Source

weakDynamicListWithIndex_ :: forall m a. MonadFRP m => MonadReplace m => WeakDynamic (Array a) -> (Int -> WeakDynamic a -> m Unit) -> m Unit

#weakDynamicList_ Source

weakDynamicList_ :: forall m a. MonadFRP m => MonadReplace m => WeakDynamic (Array a) -> (WeakDynamic a -> m Unit) -> m Unit