OeditusCredo.Check.Warning.MissingThrottle (OeditusCredo v0.5.0)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

This check has a base priority of low and works with any version of Elixir.

Explanation

Form inputs with phx-change, phx-keyup, or phx-input should include phx-debounce or phx-throttle.

This prevents excessive server events and improves performance.

Bad:

<input type="text" phx-change="search" />

Good:

<input type="text" phx-change="search" phx-debounce="300" />

Check-Specific Parameters

Use the following parameters to configure this check:

:exclude_test_files

Set to true to skip test files (default: false)

This parameter defaults to nil.

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.