Skip to content

Commit 4a89e55

Browse files
committed
Add Loading.showForever() option
1 parent d644f20 commit 4a89e55

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/component/Loading.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface LoadingExtensions extends Loading.LoadedSlotExtensions {
2222
readonly errorIcon: Component
2323
readonly errorText: Component
2424
readonly loaded: State<boolean>
25+
showForever (): this
2526
set<T> (state: State.Async<T, StringApplicatorSource>, initialiser: (slot: Loading.LoadedSlot, value: T) => unknown): this
2627
set<T> (
2728
load: (signal: AbortSignal, setProgress: (progress: number | null, details?: StringApplicatorSource) => void) => Promise<T>,
@@ -70,6 +71,9 @@ const Loading = Component((component): Loading => {
7071
refresh?.()
7172
return this
7273
},
74+
showForever () {
75+
return this.set(State.Async(State.Owner.create(), async () => { await new Promise(resolve => { }) }), () => { })
76+
},
7377
set (stateIn, initialiser) {
7478
owner?.remove(); owner = State.Owner.create()
7579

0 commit comments

Comments
 (0)