jfmengels / review-tea / NoUselessSubscriptions

rule : Review.Rule.Rule

Reports subscriptions functions that never return a subscription.

In my opinion, this is often a sign of premature architectural work, where you set up an init, view, update and subscriptions functions. I think it is better to define them as they are needed, to avoid adding upfront complexity that turn out to be unnecessary later.

config =
    [ NoUselessSubscriptions.rule
    ]

Fail

subscriptions : Model -> Sub Msg
subscriptions model =
    Sub.none

Success

main =
    Browser.element
        { init = init
        , update = update
        , subscriptions = \_ -> Sub.none
        , view = view
        }