jfmengels / elm-review-the-elm-architecture / NoMissingSubscriptionsCall

rule : Review.Rule.Rule

Reports likely missing calls to a subscriptions function.

config =
    [ NoMissingSubscriptionsCall.rule
    ]

Fail

import SomeModule

update msg model =
    case msg of
        UsedMsg subMsg ->
            SomeModule.update subMsg model.used

subscriptions model =
    -- We used `SomeModule.update` but not `SomeModule.subscriptions`
    Sub.none

This won't fail if SomeModule does not define a subscriptions function.

Success

import SomeModule

update msg model =
    case msg of
        UsedMsg subMsg ->
            SomeModule.update subMsg model.used

subscriptions model =
    SomeModule.subscriptions

Try it out

You can try this rule out by running the following command:

elm-review --template jfmengels/elm-review-the-elm-architecture/example --rules NoMissingSubscriptionsCall