Disposable Effect
A side effect of composition that must run for any new unique value of subject and must be reversed or cleaned up if subject changes or if the DisposableEffect leaves the composition.
A DisposableEffect's subject is a value that defines the identity of the DisposableEffect. If a subject changes, the DisposableEffect must dispose its current effect and reset by calling effect again. Examples of subjects include:
Observable objects that the effect subscribes to
Unique request parameters to an operation that must cancel and retry if those parameters change
DisposableEffect may be used to initialize or subscribe to a subject and reinitialize when a different subject is provided, performing cleanup for the old operation before initializing the new. For example:
Samples
A side effect of composition that must run for any new unique value of subject1 or subject2 and must be reversed or cleaned up if subject1 or subject2 changes, or if the DisposableEffect leaves the composition.
A DisposableEffect's subject is a value that defines the identity of the DisposableEffect. If a subject changes, the DisposableEffect must dispose its current effect and reset by calling effect again. Examples of subjects include:
Observable objects that the effect subscribes to
Unique request parameters to an operation that must cancel and retry if those parameters change
DisposableEffect may be used to initialize or subscribe to a subject and reinitialize when a different subject is provided, performing cleanup for the old operation before initializing the new. For example:
Samples
A side effect of composition that must run for any new unique value of subject1, subject2 or subject3 and must be reversed or cleaned up if subject1, subject2 or subject3 changes, or if the DisposableEffect leaves the composition.
A DisposableEffect's subject is a value that defines the identity of the DisposableEffect. If a subject changes, the DisposableEffect must dispose its current effect and reset by calling effect again. Examples of subjects include:
Observable objects that the effect subscribes to
Unique request parameters to an operation that must cancel and retry if those parameters change
DisposableEffect may be used to initialize or subscribe to a subject and reinitialize when a different subject is provided, performing cleanup for the old operation before initializing the new. For example:
Samples
A side effect of composition that must run for any new unique value of subjects and must be reversed or cleaned up if any subjects change or if the DisposableEffect leaves the composition.
A DisposableEffect's subject is a value that defines the identity of the DisposableEffect. If a subject changes, the DisposableEffect must dispose its current effect and reset by calling effect again. Examples of subjects include:
Observable objects that the effect subscribes to
Unique request parameters to an operation that must cancel and retry if those parameters change
DisposableEffect may be used to initialize or subscribe to a subject and reinitialize when a different subject is provided, performing cleanup for the old operation before initializing the new. For example: