W3cubDocs

/Angular

CreateEffectOptions

interface developer preview

Options passed to the effect function.

interface CreateEffectOptions {
  injector?: Injector
  manualCleanup?: boolean
  allowSignalWrites?: boolean
}

Properties

Property Description
injector?: Injector

The Injector in which to create the effect.

If this is not provided, the current injection context will be used instead (via inject).

manualCleanup?: boolean

Whether the effect should require manual cleanup.

If this is false (the default) the effect will automatically register itself to be cleaned up with the current DestroyRef.

allowSignalWrites?: boolean

Whether the effect should allow writing to signals.

Using effects to synchronize data by writing to signals can lead to confusing and potentially incorrect behavior, and should be enabled only when necessary.

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/core/CreateEffectOptions