Expose subscriptions rather than particleSystem

This commit is contained in:
Tessa Kelly 2020-05-15 10:22:24 -07:00
parent 7bcb96e186
commit 64f415564c
2 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@ module Nri.Ui.Confetti.V1 exposing
, Msg, burst, update, updateCenter , Msg, burst, update, updateCenter
, view , view
, Confetti , Confetti
, particleSystem , subscriptions
) )
{-| {-|
@ -12,7 +12,7 @@ module Nri.Ui.Confetti.V1 exposing
@docs Msg, burst, update, updateCenter @docs Msg, burst, update, updateCenter
@docs view @docs view
@docs Confetti @docs Confetti
@docs particleSystem @docs subscriptions
-} -}
@ -252,6 +252,6 @@ updateCenter center (System system _) =
{-| -} {-| -}
particleSystem : System -> ParticleSystem.System Confetti subscriptions : (Msg -> msg) -> System -> Sub msg
particleSystem (System system _) = subscriptions confettiMsg (System system _) =
system ParticleSystem.sub [] confettiMsg system

View File

@ -23,7 +23,7 @@ example =
, categories = [ Animations ] , categories = [ Animations ]
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \state -> Confetti.subscriptions ConfettiMsg state.confettiState
, view = , view =
\state -> \state ->
[ Button.button "Launch confetti!" [ Button.button "Launch confetti!"