Module

MeowClient.CloudSocket

Package
purescript-meowclient
Repository
userfriendanonymous/purescript-meowclient

#Value Source

data Value

Connection to a project's clouddata ("socket").

#id Source

id :: Value -> Int

Retrieves project id from a cloud socket.

id [cloud socket]

Example

do
   let projectId = id cloudSocket

#init Source

init :: Int -> Value -> Effect (Either Error Value)

Initializes a new cloud connection.

init [project id] [session]

Example

do
   result <- init 441270032 session
   case result of
       Left error -> -- ...
       Right cloudSocket -> -- ...

#session Source

session :: Value -> Value

Retrieves session from a cloud socket.

session [cloud socket]

Example

do
   let session' = session cloudSocket

#setVar Source

setVar :: String -> String -> Value -> Effect (Either Error Unit)

Sets a variable.

setVar [name] [value] [cloud socket]

Example

do
   result <- setVar "name" "03958200150930301"
   case result of
       Left error -> -- ...
       Right _ -> -- ...

#var Source

var :: String -> Value -> Effect (Either Error (Maybe String))

Gets a variable.

var [name] [cloud socket]

Example

do
   result <- var "name"
   case result of
       Left error -> -- ...
       Right maybeValue -> -- ...

#close Source

close :: Value -> Effect (Either Error Unit)

Closes a cloud connection.

close [cloud socket]

Example

do
   result <- close cloudSocket
   case result of
       Left error -> -- ...
       Right _ -> -- ...