Skip to content

Commit

Permalink
Merge branch 'release/v0.22.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Jul 12, 2024
2 parents 2ef1eef + c4fb262 commit b5df66f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zeed",
"type": "module",
"version": "0.22.1",
"version": "0.22.2",
"description": "🌱 Simple foundation library",
"author": {
"name": "Dirk Holtwick",
Expand Down
10 changes: 5 additions & 5 deletions src/common/dispose-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ export function useEventListenerOnce(
export function useDisposeWithUtils(config?: string | UseDisposeConfig | LoggerInterface) {
const dispose = useDispose(config)
return Object.assign(dispose, {
timeout: (fn: TimerExecFunction, timeout = 0) => dispose.add(useTimeout(fn, timeout)),
interval: (fn: TimerExecFunction, interval = 0) => dispose.add(useInterval(fn, interval)),
intervalPause: (fn: TimerExecFunction, interval = 0) => dispose.add(useIntervalPause(fn, interval)),
on: (emitter: any, eventName: string, fn: (ev?: any) => void, ...args: any[]) => dispose.add(useEventListener(emitter, eventName, fn, ...args)),
once: (emitter: any, eventName: string, fn: (ev?: any) => void, ...args: any[]) => dispose.add(useEventListenerOnce(emitter, eventName, fn, ...args)),
timeout: (fn: TimerExecFunction, timeout = 0) => dispose.add(useTimeout(fn, timeout))!,
interval: (fn: TimerExecFunction, interval = 0) => dispose.add(useInterval(fn, interval))!,
intervalPause: (fn: TimerExecFunction, interval = 0) => dispose.add(useIntervalPause(fn, interval))!,
on: (emitter: any, eventName: string, fn: (ev?: any) => void, ...args: any[]) => dispose.add(useEventListener(emitter, eventName, fn, ...args))!,
once: (emitter: any, eventName: string, fn: (ev?: any) => void, ...args: any[]) => dispose.add(useEventListenerOnce(emitter, eventName, fn, ...args))!,
})
}

Expand Down
1 change: 1 addition & 0 deletions src/common/exec/throttle-debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export function debounce<F extends (...args: any[]) => any | Promise<any>>(
lastArguments = [...args]
await exec()
}

wrapper.cancel = clearExistingTimeout
wrapper.dispose = clearExistingTimeout
wrapper.immediate = immediate
Expand Down

0 comments on commit b5df66f

Please sign in to comment.