From 5b8674cd15558280bf2ad3d39bcd2ab89ab72508 Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Sun, 26 Feb 2023 07:37:43 +0330 Subject: [PATCH] feat(element/fsm): add render_unresolved, render_resolving --- ui/element/src/mixins/state-machine.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ui/element/src/mixins/state-machine.ts b/ui/element/src/mixins/state-machine.ts index 060e9071b..bd6a869a9 100644 --- a/ui/element/src/mixins/state-machine.ts +++ b/ui/element/src/mixins/state-machine.ts @@ -1,10 +1,13 @@ +import {nothing, PropertyValues} from '../lit.js'; + import type {SignalMixinInterface} from './signal.js'; -import type {PropertyValues} from '../lit.js'; import type {FiniteStateMachine} from '@alwatr/fsm'; import type {Constructor} from '@alwatr/type'; export declare class StateMachineMixinInterface extends SignalMixinInterface { - stateMachine: TMachine; + protected stateMachine: TMachine; + protected render_unresolved(): unknown; + protected render_resolving(): unknown; } export function StateMachineMixin, TMachine extends FiniteStateMachine>( @@ -12,7 +15,14 @@ export function StateMachineMixin, T superClass: T, ): Constructor> & T { class StateMachineMixinClass extends superClass { - stateMachine = stateMachine; + protected stateMachine = stateMachine; + + protected render_unresolved(): unknown { + return nothing; + } + protected render_resolving(): unknown { + return nothing; + } override connectedCallback(): void { super.connectedCallback();