Solid.Async
- Package
- purescript-purs-solid
- Repository
- arazorda/purs-solid
Async values in the reactive graph. In createAsync, read dependencies in
the tracked Accessor layer; the Aff is untracked and is killed when a
dependency changes. Values load on the client unless ssr is serialized
or withCodec.
#serialized Source
serialized :: forall a. Serializable a => AsyncSsr aLoad on the server and send the value with the page.
#createAsyncWith Source
createAsyncWith :: forall f a given missing. Union given missing (AsyncOptions a) => AsyncResult given f => Record given -> Accessor (Aff a) -> Setup ((f a) /\ (Refresh a))Takes any subset of AsyncOptions. With a loadingValue there is always
a value to read, so the result is an Accessor.
#createAsyncFromWith Source
createAsyncFromWith :: forall f a given missing. Union given missing (AsyncOptions a) => AsyncResult given f => Record given -> Async (Aff a) -> Setup ((f a) /\ (Refresh a))Takes any subset of AsyncOptions, like createAsyncWith.
#AsyncResult Source
class AsyncResult :: Row Type -> (Type -> Type) -> Constraintclass (Tracked f) <= AsyncResult given f | given -> f
Accessor when the options have a loadingValue, Async otherwise.
Instances
(RowToList given list, AsyncResultList list f) => AsyncResult given f
#AsyncResultList Source
class AsyncResultList :: RowList Type -> (Type -> Type) -> Constraintclass (Tracked f) <= AsyncResultList list f | list -> f
Instances
AsyncResultList Nil AsyncAsyncResultList (Cons "loadingValue" a rest) Accessor(AsyncResultList rest f) => AsyncResultList (Cons label a rest) f
#Refresh Source
data Refresh t0Re-runs one async value's work even though its inputs haven't changed.
#refreshAff Source
refreshAff :: forall a. Refresh a -> Aff aRe-runs the async work and waits until the graph settles with the new value.
#UntilOptions Source
type UntilOptions :: Row Typetype UntilOptions = (timeout :: Milliseconds)
Re-exports from Solid.Internal.Serializable
#Serializable Source
class Serializable a Types that survive Solid's serialization unchanged: primitives, Unit,
Nullable, Json, arrays, objects and records of them. A newtype over
one can derive it (derive newtype instance Serializable UserId). ADTs
lose their constructors, so they need an explicit codec.
Instances
Serializable StringSerializable IntSerializable NumberSerializable BooleanSerializable UnitSerializable Json(Serializable a) => Serializable (Nullable a)(Serializable a) => Serializable (Array a)(Serializable a) => Serializable (Object a)(Serializable a) => Serializable (Reply a)(RowToList r rl, SerializableFields rl) => Serializable (Record r)(Fail (Above (Beside (Text "Can\'t send ") (Beside (Quote (Maybe a)) (Text " between server and client as-is."))) (Text "Use `Nullable` (PureScript ADTs lose their constructors when serialized)."))) => Serializable (Maybe a)(Fail (Above (Beside (Text "Can\'t send ") (Beside (Quote (Either a b)) (Text " between server and client as-is."))) (Text "Use a record of `Nullable` fields, or an explicit JSON codec."))) => Serializable (Either a b)(Fail (Text "Functions can\'t be sent between server and client.")) => Serializable (a -> b)(Fail (Text "Effects can\'t be sent between server and client.")) => Serializable (Effect 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