API Reference
@univerjs
@univerjs/core
classes
Lifecycleservice

@univerjs/core v0.4.2Docs


Class: LifecycleService

This service controls the lifecycle of a Univer instance. Other modules can inject this service to read the current lifecycle stage or subscribe to lifecycle changes.

Extends

Constructors

new LifecycleService()

new LifecycleService(_logService): LifecycleService

Parameters

ParameterType
_logServiceILogService

Returns

LifecycleService

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/core/src/services/lifecycle/lifecycle.service.ts:36 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
lifecycle$readonlyObservable<LifecycleStages>undefined-submodules/univer/packages/core/src/services/lifecycle/lifecycle.service.ts:32 (opens in a new tab)

Accessors

stage

get stage(): LifecycleStages
set stage(stage): void

Parameters

ParameterType
stageLifecycleStages

Returns

LifecycleStages

Defined in

submodules/univer/packages/core/src/services/lifecycle/lifecycle.service.ts:42 (opens in a new tab)

Methods

dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

submodules/univer/packages/core/src/services/lifecycle/lifecycle.service.ts:57 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


subscribeWithPrevious()

subscribeWithPrevious(): Observable<LifecycleStages>

Subscribe to lifecycle changes and all previous stages and the current stage will be emitted immediately.

Returns

Observable<LifecycleStages>

Defined in

submodules/univer/packages/core/src/services/lifecycle/lifecycle.service.ts:67 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.