Commit a8cfa259 authored by Duggan, John's avatar Duggan, John
Browse files

Merge branch '58-allow-args-to-be-passed-to-debounce-throttle' into 'main'

Allow arguments to be passed to debounce/throttle

Closes #58

See merge request ndip/public-packages/nova-trame!43
parents 3cbbde9e d8ffb8d0
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
[tool.poetry]
name = "nova-trame"
version = "0.14.1"
version = "0.14.2"
description = "A Python Package for injecting curated themes and custom components into Trame applications"
authors = ["Duggan, John <dugganjw@ornl.gov>"]
readme = "README.md"
+4 −4
Original line number Diff line number Diff line
@@ -4,20 +4,20 @@ class DelayManager {
        this.throttles = {}
    }

    debounce(id, func, wait) {
    debounce(id, func, wait, ...args) {
        if (!(id in this.debounces)) {
            this.debounces[id] = window.debounce(func, wait)
        }

        this.debounces[id]()
        this.debounces[id](...args)
    }

    throttle(id, func, wait) {
    throttle(id, func, wait, ...args) {
        if (!(id in this.throttles)) {
            this.throttles[id] = window.throttle(func, wait)
        }

        this.throttles[id]()
        this.throttles[id](...args)
    }
}