Namespace your flux action types to prevent collisions:
function constants(namespace, constants) {
return Object.freeze(
constants.reduce((obj, constant) => {
return {
...obj,
[constant]: `${namespace}/${constant}`
}
Namespace your flux action types to prevent collisions:
function constants(namespace, constants) {
return Object.freeze(
constants.reduce((obj, constant) => {
return {
...obj,
[constant]: `${namespace}/${constant}`
}
Animations:
<StaticContainer>
Falcor:
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Control.Monad.Except (ExceptT)
import qualified Control.Monad.Except as Except
import Control.Monad.Free
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Control.Monad.Free
import Control.Monad.Free.TH
import Control.Monad.State
let findThing id = | |
match findThingA id with | |
| None -> None | |
| Some thingA -> | |
match findThingB id with | |
| None -> None | |
| Some thingB -> | |
combine thingA thingB |
let findThing id = | |
findThingA id | |
|> Option.bind (fun thingA -> | |
findThingB id | |
|> Option.bind (fun thingB -> | |
combine thingA thingB)) |
maybe { | |
let! thingA = findThingA id | |
let! thingB = findThingB id | |
return combine thingA thingB | |
} |
match firstCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> | |
match secondCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> | |
match thirdCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> Error NotAuthorized |
let firstCheckResult () : Result<unit, NotAuthorized> = | |
match firstCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> Error NotAuthorized | |
let secondCheckResult () : Result<unit, NotAuthorized> = | |
match secondCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> Error NotAuthorized |
let allResults : Result<unit, NotAuthorized> seq = | |
seq { | |
yield firstCheckResult () | |
yield secondCheckResult () | |
yield thirdCheckResult () | |
} |