libkazv
Kazv::EffectBase< T, Action, Deps > Class Template Reference

#include <context.hpp>

Public Types

using RetType = T
 
using PromiseT = SingleTypePromise< RetType >
 
using ContextT = ContextBase< RetType, Action, Deps >
 

Public Member Functions

template<class Func >
 EffectBase (Func func)
 Constructor. More...
 
PromiseT operator() (const ContextT &ctx) const
 

Member Typedef Documentation

◆ ContextT

template<class T , class Action , class Deps = lager::deps<>>
using Kazv::EffectBase< T, Action, Deps >::ContextT = ContextBase<RetType, Action, Deps>

◆ PromiseT

template<class T , class Action , class Deps = lager::deps<>>
using Kazv::EffectBase< T, Action, Deps >::PromiseT = SingleTypePromise<RetType>

◆ RetType

template<class T , class Action , class Deps = lager::deps<>>
using Kazv::EffectBase< T, Action, Deps >::RetType = T

Constructor & Destructor Documentation

◆ EffectBase()

template<class T , class Action , class Deps = lager::deps<>>
template<class Func >
Kazv::EffectBase< T, Action, Deps >::EffectBase ( Func  func)
inline

Constructor.

Returns
An effect that runs func upon invocation. The effect will return a Promise that
  • resolves after the effect is invoked, to PromiseCombination::defaultForPromiseThen(RetType()), if func(ctx) returns void;
  • resolves after func(ctx) is resolved, to what func(ctx) resolves to, if func(ctx) returns a Promise;
  • resolves after the effect is invoked, to func(ctx) (converted to RetType if it is not already one), otherwise.

Member Function Documentation

◆ operator()()

template<class T , class Action , class Deps = lager::deps<>>
PromiseT Kazv::EffectBase< T, Action, Deps >::operator() ( const ContextT ctx) const
inline

The documentation for this class was generated from the following file: