Skip to content

Commit

Permalink
perf(pwa-element): scheduleUpdate by animation frame
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Feb 27, 2023
1 parent 333ff66 commit 388004d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ui/pwa-helper/src/pwa-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import '@alwatr/ui-kit/snackbar/controller.js';
import '@alwatr/ui-kit/style/pwa.css';
import '@alwatr/ui-kit/style/token.css';
import '@alwatr/ui-kit/top-app-bar/top-app-bar.js';
import {untilNextFrame} from '@alwatr/util';

import './signal/back-click-event.js';
import './signal/register-service-worker-command.js';
Expand Down Expand Up @@ -71,6 +72,11 @@ export class AlwatrPwaElement extends RouterMixin(SignalMixin(UnresolvedMixin(Al
},
};

protected override async scheduleUpdate(): Promise<void> {
await untilNextFrame();
super.scheduleUpdate();
}

override render(): unknown {
this._logger.logMethod('render');
return [
Expand Down

0 comments on commit 388004d

Please sign in to comment.