Module
Solid.Start.ServerFunction
- Package
- purescript-purs-solid
- Repository
- arazorda/purs-solid
Server functions are defined with serverFunction in a server module
(see Solid.Start.UseServer) and called with call from anywhere.
#serverFunction Source
serverFunction :: forall a b. Serializable a => Serializable b => (a -> Aff b) -> ServerFunction a bUse a record for several arguments.
#serverFunctionWithEvent Source
serverFunctionWithEvent :: forall a b. Serializable a => Serializable b => (RequestEvent -> a -> Aff b) -> ServerFunction a bA server function that also gets the request it runs in.
#call Source
call :: forall a b. Serializable a => Serializable b => ServerFunction a b -> a -> Aff bRuns directly on the server and over the network from the client. Killing the fiber aborts the request.
#CallOptions Source
type CallOptions :: Row Typetype CallOptions = (keepalive :: Boolean)
#callWith Source
callWith :: forall a b given missing. Serializable a => Serializable b => Union given missing CallOptions => Record given -> ServerFunction a b -> a -> Aff bTakes any subset of CallOptions.
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)
Re-exports from Solid.Internal.ServerFunction
#ServerFunction Source
data ServerFunction t0 t1- 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