| Copyright | (c) digitally induced GmbH 2025 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
IHP.ActionType
Contents
Description
Provides ActionType for tracking the current controller action type in the WAI request vault.
Synopsis
- newtype ActionType = ActionType TypeRep
- actionTypeVaultKey :: Key ActionType
- requestActionType :: Request -> ActionType
- setActionType :: Typeable controller => controller -> Request -> Request
- isActiveController :: forall {k} (controller :: k). (?request :: Request, Typeable controller) => Bool
Documentation
newtype ActionType Source #
Used to track the current action type
Constructors
| ActionType TypeRep |
Instances
| HasField "actionType" Request ActionType Source # | |
Defined in IHP.ActionType Methods getField :: Request -> 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 @PostsControllerTrue
Returns True because the current action is part of the PostsController
Orphan instances
| HasField "actionType" Request ActionType Source # | |
Methods getField :: Request -> ActionType # | |