Skip to content

Commit

Permalink
lazy init when erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseditson committed Jul 2, 2024
1 parent 80d4046 commit 02bb2da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/upd8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const cre8 = <State, Event>(

export const errored = (error: string) => {
for (const view of views.values()) {
view.errored(error);
view.internalError(error);
}
};

Expand Down Expand Up @@ -132,6 +132,11 @@ export class Upd8View<State, Event> {
this.rootElement?.classList.remove("hidden");
}

internalError(message: string) {
this._upd8_lazyInit();
this.errored(message);
}

errored(message: string) {}

showing(state: State): boolean {
Expand Down

0 comments on commit 02bb2da

Please sign in to comment.