@univerjs/core v0.4.2 • Docs
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
Parameter | Type |
---|---|
_logService | ILogService |
Returns
Overrides
Defined in
submodules/univer/packages/core/src/services/lifecycle/lifecycle.service.ts:36 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
lifecycle$ | readonly | Observable <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
Parameter | Type |
---|---|
stage | LifecycleStages |
Returns
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
Defined in
submodules/univer/packages/core/src/services/lifecycle/lifecycle.service.ts:57 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
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)