Skip to content

Commit

Permalink
Merge branch 'release/release/0.13.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Oct 3, 2023
2 parents 24f96ca + 9f2e67c commit ae33266
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 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.13.17",
"version": "0.13.18",
"description": "🌱 Simple foundation library",
"author": {
"name": "Dirk Holtwick",
Expand Down
3 changes: 1 addition & 2 deletions src/common/dispose-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,13 @@ export function useEventListenerOnce(
/** Like useDispose but with shorthands for emitter and timers */
export function useDisposeWithUtils(config?: string | UseDisposeConfig | LoggerInterface) {
const dispose = useDispose(config)
Object.assign(dispose, {
return Object.assign(dispose, {
timeout: (fn: DisposerFunction, timeout = 0) => dispose.add(useTimeout(fn, timeout)),
interval: (fn: DisposerFunction, interval = 0) => dispose.add(useInterval(fn, interval)),
intervalPause: (fn: DisposerFunction, 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)),
})
return dispose
}

export type UseDisposeWithUtils = ReturnType<typeof useDisposeWithUtils>

0 comments on commit ae33266

Please sign in to comment.