Solid.Control
- Package
- purescript-purs-solid
- Repository
- arazorda/purs-solid
Control flow. A branch is only created while it's shown; render callbacks
run in Setup, so each item or branch owns its state until it leaves.
Conditions and lists are an Accessor or an Async (Tracked f). A bare
pure x could be either, so when (pure b) doesn't compile ("the instance
head contains unknown type variables"): a fixed condition is a plain
if b then … else empty, or annotate it (pure b :: Accessor Boolean).
#forEachElse Source
forEachElse :: forall f a. Tracked f => StableIdentity a => f (Array a) -> (a -> Accessor Int -> Setup JSX) -> JSX -> JSX#caseOn Source
caseOn :: forall f a k. Tracked f => Eq k => (a -> k) -> f a -> (a -> Accessor a -> Setup JSX) -> JSXRenders a branch per key of value, rebuilding it only when the key
changes (by Eq). The branch gets the value it was built for, to pattern
match on, and the accessor for later changes under the same key:
caseOn constructorName page \current latest -> case current of
Home -> homeView
Profile _ -> profileView latest
#constructorName Source
constructorName :: forall a rep. Generic a rep => ConstructorName rep => a -> StringThe name of a value's constructor, e.g. to key caseOn by constructor.
#ConstructorName Source
class ConstructorName rep whereMembers
constructorNameOf :: rep -> String
Instances
(ConstructorName a, ConstructorName b) => ConstructorName (Sum a b)(IsSymbol name) => ConstructorName (Constructor name arguments)
#sequential Source
sequential :: RevealOrderIn order: each waits for the ones before it.
#together Source
together :: RevealOrderAll at once, when all are ready.
#natural Source
natural :: RevealOrderEach as soon as it's ready.
#RevealOptions Source
type RevealOptions :: Row Typetype RevealOptions = (collapsed :: Boolean, order :: RevealOrder)
#noHydration Source
noHydration :: JSX -> JSXServer-rendered content that isn't hydrated.
Re-exports from Solid.Internal.Identity
#StableIdentity Source
class StableIdentity a Values that stay === when a list is recomputed, so a list keyed by its
items keeps each row: primitives and store cursors.
Instances
StableIdentity IntStableIdentity NumberStableIdentity StringStableIdentity BooleanStableIdentity CharStableIdentity (Store a)StableIdentity (AsyncStore a)(Fail (Above (Text "Rows keyed by identity (===) are rebuilt whenever a ") (Above (Quote a) (Text " is rebuilt. Key by a field (forEachBy _.id), render Store.items, or use forEachByReference when the list keeps the same values.")))) => StableIdentity a
- Modules
- Solid.
Action - Solid.
Async - Solid.
Component - Solid.
Component. JS - Solid.
Context - Solid.
Control - Solid.
DOM - Solid.
DOM. Aria - Solid.
DOM. AttrValue - Solid.
DOM. HTML - Solid.
DOM. SVG - Solid.
Errors - Solid.
Internal. Action - Solid.
Internal. Equality - Solid.
Internal. Identity - Solid.
Internal. Names - Solid.
Internal. Optimistic - Solid.
Internal. Props - Solid.
Internal. Reply - Solid.
Internal. Serializable - Solid.
Internal. ServerFunction - Solid.
Internal. Setup - Solid.
Internal. Store - Solid.
Internal. Tracked - Solid.
Internal. View - Solid.
JSX - Solid.
Lifecycle - Solid.
Meta - Solid.
Owner - Solid.
Reactivity - Solid.
Root - Solid.
Router - Solid.
Router. Action - Solid.
Router. Path - Solid.
Router. Query - Solid.
Router. Search - Solid.
Setup - Solid.
Signal - Solid.
Start. Middleware - Solid.
Start. RequestEvent - Solid.
Start. Response - Solid.
Start. ServerFunction - Solid.
Start. UseServer - Solid.
Store - Solid.
Testing - Solid.
Utility - Solid.
Web - Solid.
Web. SSR