[{"name":"RecentEventCounter","comment":" This module provides functionality of counting some events which happened in user-determined certain time range.\nYou can stop and restart the time-induced change as you like.\nUseful for scorering typing-practice game etc.\n\n\n# Types\n\n@docs RecentEventCounter\n\n\n# Creation\n\n@docs create\n\n\n# Modification\n\n\n## Incrementing event count\n\n@docs increment\n\n\n## Change over time\n\n@docs subscribe\n\n\n## Stop & Restart\n\n@docs stop, start, toggle\n\n\n## Discarding the content\n\n@docs resetCounter, resetWhole\n\n\n# Query\n\n@docs count, isMoving, passedMillis\n\n","unions":[{"name":"RecentEventCounter","comment":" An opaque type representating a counter for events having recently happend.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"count","comment":" Return how many times `increment` is called during the user-defined length of time by now.\n","type":"RecentEventCounter.RecentEventCounter -> Basics.Int"},{"name":"create","comment":" create a `RecentEventCounter` from some configuration. Recode is used in order to prevent user from misunderstanding the time unit.\n","type":"{ durationInMillis : Basics.Float, moving : Basics.Bool } -> RecentEventCounter.RecentEventCounter"},{"name":"increment","comment":" Call this when the observed event happend.\n\n    rec : RecentEventCounter\n    rec = create { durationInMillis = 30000, isMoving = False}\n\n    rec\n        |> increment\n        |> count\n        --> 1\n\n","type":"RecentEventCounter.RecentEventCounter -> RecentEventCounter.RecentEventCounter"},{"name":"isMoving","comment":" Returns if the timer is currently moving.\n","type":"RecentEventCounter.RecentEventCounter -> Basics.Bool"},{"name":"passedMillis","comment":" Returns time in milliseconds passed with the timer moving.\n","type":"RecentEventCounter.RecentEventCounter -> Basics.Float"},{"name":"resetCounter","comment":" Return `RecentEventCounter` with the event count forgotten,\nwhile the passed time from initialization of the application is remained.\n","type":"RecentEventCounter.RecentEventCounter -> RecentEventCounter.RecentEventCounter"},{"name":"resetWhole","comment":" Return `RecentEventCounter` in completely seme state as it was created.\n","type":"RecentEventCounter.RecentEventCounter -> RecentEventCounter.RecentEventCounter"},{"name":"start","comment":" Make the timer moves whichever it has been originally moving or not.\n","type":"RecentEventCounter.RecentEventCounter -> RecentEventCounter.RecentEventCounter"},{"name":"stop","comment":" Make the timer stops whichever it has been originally moving or not.\n","type":"RecentEventCounter.RecentEventCounter -> RecentEventCounter.RecentEventCounter"},{"name":"subscribe","comment":" Make subscription for the time-induced change of RecentEventCounter. If the timer is moving, the passed milliseconds is enlarged each frame. Otherwise nothing changes. If the oldest event memorized expires its lifetime then the event is forgotton and the event count decreases by one.\n\n        subscribe toMsg rec\n\n","type":"(RecentEventCounter.RecentEventCounter -> msg) -> RecentEventCounter.RecentEventCounter -> Platform.Sub.Sub msg"},{"name":"toggle","comment":" If the timer is moving, then stops it. Else, restart the timer.\n","type":"RecentEventCounter.RecentEventCounter -> RecentEventCounter.RecentEventCounter"}],"binops":[]}]