ihp-1.4.0: Haskell Web Framework
Copyright(c) digitally induced GmbH 2025
Safe HaskellNone
LanguageGHC2021

IHP.ActionType

Description

Provides ActionType for tracking the current controller action type in the WAI request vault.

Synopsis

Documentation

newtype ActionType Source #

Used to track the current action type

Constructors

ActionType TypeRep 

Instances

Instances details
HasField "actionType" Request ActionType Source # 
Instance details

Defined in IHP.ActionType

setActionType :: Typeable controller => controller -> Request -> Request Source #

Insert the ActionType into the request vault

isActiveController :: forall {k} (controller :: k). (?request :: Request, Typeable controller) => Bool Source #

Returns True when the given type matches the type of the currently executed controller action

Example: The browser has requested /Posts and the Posts action of the PostsController is called.

>>> isActiveController @PostsController
True

Returns True because the current action is part of the PostsController

Orphan instances

HasField "actionType" Request ActionType Source # 
Instance details