Skip to content

Commit 687264a

Browse files
committed
Remove Component from event
1 parent 3e2a7db commit 687264a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/LiveComponent/assets/src/Component/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ export default class Component {
145145
* * render:started (html: string, response: BackendResponse, controls: { shouldRender: boolean }) => {}
146146
* * render:finished (component: Component) => {}
147147
* * response:error (backendResponse: BackendResponse, controls: { displayError: boolean }) => {}
148-
* * loading.state:started (element: HTMLElement, request: BackendRequest, component: Component) => {}
149-
* * loading.state:finished (element: HTMLElement, component: Component) => {}
148+
* * loading.state:started (element: HTMLElement, request: BackendRequest) => {}
149+
* * loading.state:finished (element: HTMLElement) => {}
150150
* * model:set (model: string, value: any, component: Component) => {}
151151
*/
152152
on(hookName: string, callback: (...args: any[]) => void): void {
@@ -383,7 +383,7 @@ export default class Component {
383383
this.valueStore.getUpdatedPropsFromParent(),
384384
filesToSend,
385385
);
386-
this.hooks.triggerHook('loading.state:started', this.element, this.backendRequest, this);
386+
this.hooks.triggerHook('loading.state:started', this.element, this.backendRequest);
387387

388388
this.pendingActions = [];
389389
this.valueStore.flushDirtyPropsToPending();
@@ -453,7 +453,7 @@ export default class Component {
453453
// remove the loading behavior now so that when we morphdom
454454
// "diffs" the elements, any loading differences will not cause
455455
// elements to appear different unnecessarily
456-
this.hooks.triggerHook('loading.state:finished', this.element, this);
456+
this.hooks.triggerHook('loading.state:finished', this.element);
457457

458458
/**
459459
* For any models modified since the last request started, grab

src/LiveComponent/assets/src/Component/plugins/LoadingPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ interface ElementLoadingDirectives {
1616

1717
export default class implements PluginInterface {
1818
attachToComponent(component: Component): void {
19-
component.on('loading.state:started', (element: HTMLElement, request: BackendRequest, component: Component) => {
19+
component.on('loading.state:started', (element: HTMLElement, request: BackendRequest) => {
2020
this.startLoading(component, element, request);
2121
});
22-
component.on('loading.state:finished', (element: HTMLElement, component: Component) => {
22+
component.on('loading.state:finished', (element: HTMLElement) => {
2323
this.finishLoading(component, element);
2424
});
2525
// hide "loading" elements to begin with

src/LiveComponent/doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,8 @@ The following hooks are available (along with the arguments that are passed):
889889
* ``render:started`` args ``(html: string, response: BackendResponse, controls: { shouldRender: boolean })``
890890
* ``render:finished`` args ``(component: Component)``
891891
* ``response:error`` args ``(backendResponse: BackendResponse, controls: { displayError: boolean })``
892-
* ``loading.state:started`` args ``(element: HTMLElement, request: BackendRequest, component: Component)``
893-
* ``loading.state:finished`` args ``(element: HTMLElement, component: Component)``
892+
* ``loading.state:started`` args ``(element: HTMLElement, request: BackendRequest)``
893+
* ``loading.state:finished`` args ``(element: HTMLElement)``
894894
* ``model:set`` args ``(model: string, value: any, component: Component)``
895895

896896
Loading States

0 commit comments

Comments
 (0)