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 b

Use a record for several arguments.

#serverFunctionWithEvent Source

serverFunctionWithEvent :: forall a b. Serializable a => Serializable b => (RequestEvent -> a -> Aff b) -> ServerFunction a b

A 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 b

Runs 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 b

Takes 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

Re-exports from Solid.Internal.ServerFunction

#ServerFunction Source

data ServerFunction t0 t1