Play.Extra
- Package
- purescript-play
- Repository
- shamansir/purescript-play
#addChildAt Source
addChildAt :: forall a. ItemPath -> Play a -> Play a -> Play aAdd a new child layout at a specific path. The new child is appended to the end of the existing children list. Returns the original layout unchanged if the parent path doesn't exist.
#removeChildAt Source
removeChildAt :: forall a. ItemPath -> Int -> Play a -> Play aRemove a child at a specific index from the element at the given path. Returns the original layout unchanged if the parent path doesn't exist or if the child index is out of bounds.
Parameters:
path: Path to the parent elementchildIndex: Index of the child to remove (0-based)
#findBy Source
findBy :: forall a. (a -> Boolean) -> Play a -> Maybe (ItemPath /\ (Play a))Find the first sub-layout in the layout tree in the layout tree that satisfies the given predicate.
Returns Nothing if no such item exists.
The returned value includes both the path to the item and the item itself.
Root is at path [].
#findInLayout Source
findInLayout :: forall a. Eq a => a -> Layout a -> Maybe (ItemPath /\ (Tree (WithRect a)))Find the first sub-layout in the layout tree that is bound to the provided value.
Returns Nothing if no such item exists.
The returned value includes both the path to the item and its layout.
Root is at path [].
#findByInLayout Source
findByInLayout :: forall a. (a -> Boolean) -> Layout a -> Maybe (ItemPath /\ (Tree (WithRect a)))Find the first sub-layout in the layout tree in the layout tree that satisfies the given predicate.
Returns Nothing if no such item exists.
The returned value includes both the path to the item and the item itself.
Root is at path [].
- Modules
- Play
- Play.
Extra - Play.
Types