File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
assets/js/phoenix_live_view Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ export default class View {
543543 ! fromEl . isEqualNode ( toEl ) &&
544544 ! ( isIgnored && isEqualObj ( fromEl . dataset , toEl . dataset ) )
545545 ) {
546- hook . __beforeUpdate ( ) ;
546+ hook . __beforeUpdate ( fromEl , toEl ) ;
547547 return hook ;
548548 }
549549 }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export interface HookInterface<E extends HTMLElement = HTMLElement> {
3535 * Called when the element is about to be updated in the DOM.
3636 * Note: any call here must be synchronous as the operation cannot be deferred or cancelled.
3737 */
38- beforeUpdate ?: ( ) => void ;
38+ beforeUpdate ?: ( fromEl : E , toEl : E ) => void ;
3939
4040 /**
4141 * The updated callback.
@@ -173,7 +173,7 @@ export interface Hook<T = object, E extends HTMLElement = HTMLElement> {
173173 * Called when the element is about to be updated in the DOM.
174174 * Note: any call here must be synchronous as the operation cannot be deferred or cancelled.
175175 */
176- beforeUpdate ?: ( this : T & HookInterface < E > ) => void ;
176+ beforeUpdate ?: ( this : T & HookInterface < E > , fromEl : E , toEl : E ) => void ;
177177
178178 /**
179179 * The updated callback.
@@ -347,7 +347,7 @@ export class ViewHook<E extends HTMLElement = HTMLElement>
347347
348348 // Default lifecycle methods
349349 mounted ( ) : void { }
350- beforeUpdate ( ) : void { }
350+ beforeUpdate ( _fromEl : E , _toEl : E ) : void { }
351351 updated ( ) : void { }
352352 destroyed ( ) : void { }
353353 disconnected ( ) : void { }
@@ -364,8 +364,8 @@ export class ViewHook<E extends HTMLElement = HTMLElement>
364364 this . updated ( ) ;
365365 }
366366 /** @internal */
367- __beforeUpdate ( ) {
368- this . beforeUpdate ( ) ;
367+ __beforeUpdate ( fromEl , toEl ) {
368+ this . beforeUpdate ( fromEl , toEl ) ;
369369 }
370370 /** @internal */
371371 __destroyed ( ) {
You can’t perform that action at this time.
0 commit comments