Origami Frontend Components & Services

JSDoc: o-utils

debounce(func, wait)

Global Function

Debounces function so it is only called after n milliseconds without it not being called

parameter type default description
func function Function to be debounced
wait number Time in miliseconds

Returns

  • function - - Debounced function

Example

Utils.debounce(myFunction() {}, 100);

Links

throttle(func, wait)

Global Function

Throttle function so it is only called once every n milliseconds

parameter type default description
func function Function to be throttled
wait number Time in miliseconds

Returns

  • function - - Throttled function

Example

Utils.throttle(myFunction() {}, 100);

Links

Switch component view

GitHub Repository

Install o-utils

If using the Build Service, add o-utils@^1.0.6 to your script tag.

If running a Manual Build, run bower install --save "o-utils@^1.0.6".

Help & Support

o-utils is maintained directly by the Origami team. If you have any questions about o-utils or Origami in general, we are happy to help. 😊

Slack: #ft-origami
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #ft-origami
Email: origami.support@ft.com