Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / coroutines/src/public-api / withCancel

Function: withCancel()

withCancel(parent?): [Context, Cancel]

Defined in: projects/libraries/streamix/coroutines/src/lib/utils/context.ts:102

Derives a cancellable child context from a parent.

The child is automatically cancelled when the parent is cancelled.

Parameters

parent?

Context = ...

The parent context. Defaults to background().

Returns

[Context, Cancel]

A tuple of [childContext, cancel].

Released under the GNU AGPL v3 or later.