Created
May 31, 2016 05:30
-
-
Save vic/f486ac7a87492f737f4d08ef5b7cd7c7 to your computer and use it in GitHub Desktop.
empty useless effect manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
effect module My where { command = MyCmd } exposing | |
( init | |
) | |
import Task exposing (Task) | |
import Platform.Cmd exposing (Cmd) | |
-- Manager | |
type MyState x | |
= State () | |
type alias MyTask msg | |
= Task Never (MyState msg) | |
type MyCmd msg | |
= NoOp | |
init : MyTask msg | |
init = | |
Task.succeed (State ()) | |
cmdMap : (a -> b) -> MyCmd a -> MyCmd b | |
cmdMap tagger cmd = | |
case cmd of | |
NoOp -> NoOp | |
onEffects | |
: Platform.Router msg (MyCmd msg) | |
-> List (MyCmd msg) | |
-> MyState msg | |
-> MyTask msg | |
onEffects router commands state = | |
Task.succeed state | |
onSelfMsg | |
: Platform.Router msg (MyCmd msg) | |
-> MyCmd msg | |
-> MyState msg | |
-> MyTask msg | |
onSelfMsg router command state = | |
Task.succeed state | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment