Skip to content

Commit

Permalink
Mention default times for phx-debounce and phx-throttle (#2512)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko authored Mar 9, 2023
1 parent f397224 commit f7cfc4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guides/client/bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ Rate limited and debounced events have the following behavior:
* `phx-debounce` - Accepts either an integer timeout value (in milliseconds),
or `"blur"`. When an integer is provided, emitting the event is delayed by
the specified milliseconds. When `"blur"` is provided, emitting the event is
delayed until the field is blurred by the user. Debouncing is typically used for
input elements.
delayed until the field is blurred by the user. When the value is omitted
a default of 300ms is used. Debouncing is typically used for input elements.

* `phx-throttle` - Accepts an integer timeout value to throttle the event in milliseconds.
Unlike debounce, throttle will immediately emit the event, then rate limit it at once
per provided timeout. Throttling is typically used to rate limit clicks, mouse and
keyboard actions.
per provided timeout. When the value is omitted a default of 300ms is used.
Throttling is typically used to rate limit clicks, mouse and keyboard actions.

For example, to avoid validating an email until the field is blurred, while validating
the username at most every 2 seconds after a user changes the field:
Expand Down

0 comments on commit f7cfc4f

Please sign in to comment.