[{"name":"Debouncer","comment":" Debounce or throttle your actions.\n\n\n# Debouncer\n\n@docs Debouncer\n\n\n# Constructors\n\n@docs init\n\n\n# Configurations\n\n@docs Config, SimpleConfigOptions, trailing, leading, throttle, CustomConfigOptions, custom\n\n\n# Operations\n\n@docs call, Msg, update, cancel\n\n","unions":[{"name":"Config","comment":" The configuration for a debouncer.\n","args":["a","msg"],"cases":[]},{"name":"Debouncer","comment":" The type variable `a` represents the type of the argument the action depends\nupon.\n\nFor e.g. if you're debouncing a search field, your ability to perform the search\nwill most likely depend upon a query string. So, in this case, `a` will be\n`String`.\n\n","args":["a"],"cases":[]},{"name":"Msg","comment":" The messages that are handled by the [`update`](#update) function.\n","args":[],"cases":[]}],"aliases":[{"name":"CustomConfigOptions","comment":" The configuration options used by the [custom](#custom) configuration\nconstructor.\n\n  - `invokeOnLeading`: Whether or not to send the `onReady` constructed message\n    immediately upon calling [`call`](#call).\n  - `invokeOnTrailing`: Whether or not to send the `onReady` constructed message\n    `wait` milliseconds after you last called [`call`](#call).\n  - `maxWait`: If it's `Just n` then `n` is a non-negative integer (`>= wait`)\n    that represents the maximum number of milliseconds to delay. Once that time is\n    up the `onReady` constructed message is sent.\n\n**Note 1:** `wait`, `onReady`, and `onChange` are the same as in\n[`SimpleConfigOptions`](#SimpleConfigOptions).\n\n**Note 2:** The custom configuration options were heavily influenced by Lodash's\n[debounce](https://lodash.com/docs/4.17.15#debounce) function.\n\n","args":["a","msg"],"type":"{ invokeOnLeading : Basics.Bool, invokeOnTrailing : Basics.Bool, wait : Basics.Int, maxWait : Maybe.Maybe Basics.Int, onReady : a -> msg, onChange : Debouncer.Msg -> msg }"},{"name":"SimpleConfigOptions","comment":" The configuration options used by the [`trailing`](#trailing),\n[`leading`](#leading), and [`throttle`](#throttle) configuration constructors.\n\n  - `wait`: A non-negative (`>= 0`) integer that represents the number of\n    milliseconds to delay. Its exact meaning depends on the configuration\n    constructor you've used.\n  - `onReady`: The message constructor to use to create the message that will be\n    sent to your update function when it's time to perform the action you've been\n    delaying.\n  - `onChange`: Convert [`Msg`](#Msg) to your message type. Basically, say\n    how to `Cmd.map` the commands that will be returned from [`call`](#call) and\n    [`update`](#update).\n\n","args":["a","msg"],"type":"{ wait : Basics.Int, onReady : a -> msg, onChange : Debouncer.Msg -> msg }"}],"values":[{"name":"call","comment":" Call this function instead of performing the action which you want to\ndelay. It will update the debouncer and determine when to send the `onReady arg`\nmessage.\n\n  - `onReady`: The message constructor you set when creating your configuration.\n  - `arg`: The argument, of type `a`, you passed to [`call`](#call).\n\nYou handle the `onReady arg` message by performing the action which you've been\ndelaying.\n\n","type":"Debouncer.Config a msg -> a -> Debouncer.Debouncer a -> ( Debouncer.Debouncer a, Platform.Cmd.Cmd msg )"},{"name":"cancel","comment":" It will reset the debouncer and you will not receive any previously\nscheduled `onReady` constructed messages.\n","type":"Debouncer.Debouncer a -> Debouncer.Debouncer a"},{"name":"custom","comment":" Create a fully customized configuration.\n","type":"Debouncer.CustomConfigOptions a msg -> Debouncer.Config a msg"},{"name":"init","comment":" Create a debouncer.\n","type":"Debouncer.Debouncer a"},{"name":"leading","comment":" Create the configuration for a leading edge debouncer.\n\nSuppose `wait = 400ms`, then you can expect the following behaviour:\n\n```txt\n--aaa--a-a--a-----b---b-bb--b-------c-------\n--a---------------b-----------------c-------\n```\n\n**Note:** Each `-` represents `100ms`.\n\nPlay with the\n[leading edge demo](https://dwayne.github.io/elm-debouncer/leadingDemo.html)\nto better understand how this configuration really works.\n\n","type":"Debouncer.SimpleConfigOptions a msg -> Debouncer.Config a msg"},{"name":"throttle","comment":" Create the configuration for a throttler.\n\nSuppose `wait = 400ms`, then you can expect the following behaviour:\n\n```txt\n--aaa--a-a--a-----b---b-bb--b-------c-------\n--a---a----a----a-b---b----b----b---c-------\n```\n\n**Note:** Each `-` represents `100ms`.\n\nPlay with the\n[throttle demo](https://dwayne.github.io/elm-debouncer/throttleDemo.html)\nto better understand how this configuration really works.\n\n","type":"Debouncer.SimpleConfigOptions a msg -> Debouncer.Config a msg"},{"name":"trailing","comment":" Create the configuration for a trailing edge debouncer.\n\nSuppose `wait = 400ms`, then you can expect the following behaviour:\n\n```txt\n--aaa--a-a--a-----b---b-bb--b-------c-------\n-----------------a---------------b-------c--\n```\n\n**Note:** Each `-` represents `100ms`.\n\nPlay with the\n[trailing edge demo](https://dwayne.github.io/elm-debouncer/trailingDemo.html)\nto better understand how this configuration really works.\n\n","type":"Debouncer.SimpleConfigOptions a msg -> Debouncer.Config a msg"},{"name":"update","comment":" Update the debouncer and determine when to send the `onReady lastArg`\nmessage.\n\n  - `onReady`: The message constructor you set when creating your configuration.\n  - `lastArg`: The argument, of type `a`, that you passed the last time you\n    invoked [`call`](#call).\n\nYou handle the `onReady lastArg` message by performing the action which you've\nbeen delaying.\n\n","type":"Debouncer.Config a msg -> Debouncer.Msg -> Debouncer.Debouncer a -> ( Debouncer.Debouncer a, Platform.Cmd.Cmd msg )"}],"binops":[]}]