IHP Api Reference
Copyright(c) digitally induced GmbH 2021
Safe HaskellNone

IHP.ServerSideComponent.Types

Description

 

Documentation

class Component state action | state -> action where Source #

Minimal complete definition

initialState, render, action

Methods

initialState :: state Source #

render :: state -> Html Source #

action :: (?instanceRef :: IORef (ComponentInstance state), ?connection :: Connection, ?context :: ControllerContext, ?modelContext :: ModelContext) => state -> action -> IO state Source #

componentDidMount :: (?instanceRef :: IORef (ComponentInstance state), ?connection :: Connection, ?context :: ControllerContext, ?modelContext :: ModelContext) => state -> IO state Source #

data ComponentsController components Source #

Constructors

ComponentsController 

Instances

Instances details
Eq (ComponentsController components) Source # 
Instance details

Defined in IHP.ServerSideComponent.Types

Methods

(==) :: ComponentsController components -> ComponentsController components -> Bool #

(/=) :: ComponentsController components -> ComponentsController components -> Bool #

Data components => Data (ComponentsController components) Source # 
Instance details

Defined in IHP.ServerSideComponent.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ComponentsController components -> c (ComponentsController components) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ComponentsController components) #

toConstr :: ComponentsController components -> Constr #

dataTypeOf :: ComponentsController components -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ComponentsController components)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ComponentsController components)) #

gmapT :: (forall b. Data b => b -> b) -> ComponentsController components -> ComponentsController components #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ComponentsController components -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ComponentsController components -> r #

gmapQ :: (forall d. Data d => d -> u) -> ComponentsController components -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ComponentsController components -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ComponentsController components -> m (ComponentsController components) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ComponentsController components -> m (ComponentsController components) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ComponentsController components -> m (ComponentsController components) #

Show (ComponentsController components) Source # 
Instance details

Defined in IHP.ServerSideComponent.Types

Methods

showsPrec :: Int -> ComponentsController components -> ShowS #

show :: ComponentsController components -> String

showList :: [ComponentsController components] -> ShowS #

(Component component controller, FromJSON controller) => WSApp (ComponentsController component) Source # 
Instance details

Defined in IHP.ServerSideComponent.Controller.ComponentsController

data ComponentInstance state Source #

Constructors

ComponentInstance

If you wondered why the current rendered HTML doesn't need to be stored here for later diffing it: As our render functions are pure we can just re-render the HTML based on the state when we want to do our diffing

Fields

Instances

Instances details
SetField "state" (ComponentInstance state) state Source # 
Instance details

Defined in IHP.ServerSideComponent.Types

Methods

setField :: state -> ComponentInstance state -> ComponentInstance state Source #