Skip to content

Allow accessing cliOptions from subscriptions #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/src/Curl.elm
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ main =
, init = init
, config = program
, update = update
, subscriptions = \_ -> Sub.none
, subscriptions = \_ _ -> Sub.none
}
4 changes: 2 additions & 2 deletions examples/src/Grep.elm
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ update cliOptions msg model =
( model, Cmd.none )


subscriptions : a -> Sub Msg
subscriptions model =
subscriptions : CliOptions -> a -> Sub Msg
subscriptions _ model =
Sub.map OnStdin Stdin.subscriptions


Expand Down
4 changes: 2 additions & 2 deletions src/Cli/Program.elm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type alias StatefulOptions msg model cliOptions flags =
, printAndExitSuccess : String -> Cmd msg
, init : FlagsIncludingArgv flags -> cliOptions -> ( model, Cmd msg )
, update : cliOptions -> msg -> model -> ( model, Cmd msg )
, subscriptions : model -> Sub msg
, subscriptions : cliOptions -> model -> Sub msg
, config : Config cliOptions
}

Expand Down Expand Up @@ -188,7 +188,7 @@ stateful options =
\model ->
case model of
UserModel actualModel cliOptions ->
options.subscriptions actualModel
options.subscriptions cliOptions actualModel

ShowSystemMessage ->
Sub.none
Expand Down