Skip to content

Commit

Permalink
pass inEvent so custom debouncers can mirror our logic (#3909)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Feb 21, 2023
1 parent 17ce063 commit cc88ae6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function enqueueRender(c) {
prevDebounce !== options.debounceRendering
) {
prevDebounce = options.debounceRendering;
(prevDebounce || defer)(process);
(prevDebounce || defer)(process, inEvent);
}
}

Expand Down
14 changes: 4 additions & 10 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,10 @@ interface ContainerNode {
insertBefore: Node['insertBefore'];
appendChild: Node['appendChild'];
removeChild: Node['removeChild'];
childNodes: ArrayLike<Node>
childNodes: ArrayLike<Node>;
}

export function render(
vnode: ComponentChild,
parent: ContainerNode
): void;
export function render(vnode: ComponentChild, parent: ContainerNode): void;
/**
* @deprecated Will be removed in v11.
*
Expand All @@ -299,10 +296,7 @@ export function render(
parent: ContainerNode,
replaceNode?: Element | Text
): void;
export function hydrate(
vnode: ComponentChild,
parent: ContainerNode
): void;
export function hydrate(vnode: ComponentChild, parent: ContainerNode): void;
export function cloneElement(
vnode: VNode<any>,
props?: any,
Expand Down Expand Up @@ -337,7 +331,7 @@ export interface Options {
diffed?(vnode: VNode): void;
event?(e: Event): any;
requestAnimationFrame?(callback: () => void): void;
debounceRendering?(cb: () => void): void;
debounceRendering?(cb: () => void, inEvent: boolean): void;
useDebugValue?(value: string | number): void;
_addHookName?(name: string | number): void;
__suspenseDidResolve?(vnode: VNode, cb: () => void): void;
Expand Down

0 comments on commit cc88ae6

Please sign in to comment.