@reactive-js/core
Advanced tools
Comparing version 0.25.0 to 0.26.0
@@ -42,17 +42,2 @@ import { Equality, Factory, Function1, Optional, Predicate, Reducer, SideEffect1, TypePredicate, Updater } from "./functions.js"; | ||
} | ||
/** @ignore */ | ||
export declare const SequenceLike_data: unique symbol; | ||
/** @ignore */ | ||
export declare const SequenceLike_next: unique symbol; | ||
/** | ||
* @noInheritDoc | ||
* @category Container | ||
*/ | ||
export interface SequenceLike<T = unknown> extends ContainerLike { | ||
readonly [ContainerLike_type]?: SequenceLike<this[typeof ContainerLike_T]>; | ||
(): Optional<{ | ||
readonly [SequenceLike_data]: T; | ||
readonly [SequenceLike_next]: SequenceLike<T>; | ||
}>; | ||
} | ||
/** @ignore */ | ||
@@ -413,12 +398,2 @@ export declare const EnumeratorLike_move: unique symbol; | ||
*/ | ||
export interface FromSequence<C extends ContainerLike, O = never> extends Container<C> { | ||
/** | ||
* @category Constructor | ||
*/ | ||
fromSequence<T>(options?: O): Function1<SequenceLike<T>, ContainerOf<C, T>>; | ||
} | ||
/** | ||
* @noInheritDoc | ||
* @category TypeClass | ||
*/ | ||
export interface Generate<C extends ContainerLike, O = never> extends Container<C> { | ||
@@ -753,14 +728,2 @@ /** | ||
*/ | ||
export interface ToSequence<C extends ContainerLike, O = never> extends Container<C> { | ||
/** | ||
* Converts the ContainerLike to a `SequenceLike`. | ||
* | ||
* @category Transform | ||
*/ | ||
toSequence<T>(options?: O): Function1<ContainerOf<C, T>, SequenceLike<T>>; | ||
} | ||
/** | ||
* @noInheritDoc | ||
* @category TypeClass | ||
*/ | ||
export interface Zip<C extends ContainerLike> extends Container<C> { | ||
@@ -767,0 +730,0 @@ /** |
@@ -5,6 +5,2 @@ /** @ignore */ | ||
export const ContainerLike_type = Symbol("ContainerLike_type"); | ||
/** @ignore */ | ||
export const SequenceLike_data = Symbol("SequenceLike_data"); | ||
/** @ignore */ | ||
export const SequenceLike_next = Symbol("SequenceLike_next"); | ||
/** @ignore */ | ||
@@ -11,0 +7,0 @@ export const EnumeratorLike_move = Symbol("EnumeratorLike_move"); |
@@ -1,2 +0,2 @@ | ||
import { Enumerate, FromReadonlyArray, FromSequence, IterableLike, ToIterable, ToReadonlyArray } from "../containers.js"; | ||
import { Enumerate, FromReadonlyArray, IterableLike, ToIterable, ToReadonlyArray } from "../containers.js"; | ||
import { ToEnumerable, ToObservable, ToRunnable } from "../rx.js"; | ||
@@ -6,3 +6,2 @@ import { ToAsyncEnumerable, ToFlowable } from "../streaming.js"; | ||
export declare const fromReadonlyArray: FromReadonlyArray<IterableLike>["fromReadonlyArray"]; | ||
export declare const fromSequence: FromSequence<IterableLike>["fromSequence"]; | ||
export declare const toAsyncEnumerable: ToAsyncEnumerable<IterableLike, { | ||
@@ -9,0 +8,0 @@ delay?: number; |
@@ -8,6 +8,4 @@ import { identity, returns } from "../functions.js"; | ||
import ReadonlyArray_toReadonlyArray from "./ReadonlyArray/__internal__/ReadonlyArray.toReadonlyArray.js"; | ||
import Sequence_toIterable from "./Sequence/__internal__/Sequence.toIterable.js"; | ||
export const enumerate = Iterable_enumerate; | ||
export const fromReadonlyArray = ReadonlyArray_toReadonlyArray; | ||
export const fromSequence = Sequence_toIterable; | ||
export const toAsyncEnumerable = Iterable_toAsyncEnumerable; | ||
@@ -14,0 +12,0 @@ export const toEnumerable = Iterable_toObservable; |
@@ -1,2 +0,2 @@ | ||
import { Empty, Enumerate, Every, First, ForEach, FromIterable, FromOptional, FromReadonlyArray, FromSequence, Keep, KeepType, Last, Map, ReadonlyArrayLike, Some, ToIterable, ToReadonlyArray, ToSequence } from "../containers.js"; | ||
import { Empty, Enumerate, Every, First, ForEach, FromIterable, FromOptional, FromReadonlyArray, Keep, KeepType, Last, Map, ReadonlyArrayLike, Some, ToIterable, ToReadonlyArray } from "../containers.js"; | ||
import { FromEnumerable, FromRunnable, ToEnumerable, ToObservable, ToRunnable } from "../rx.js"; | ||
@@ -14,3 +14,2 @@ import { ToAsyncEnumerable, ToFlowable } from "../streaming.js"; | ||
export declare const fromRunnable: FromRunnable<ReadonlyArrayLike>["fromRunnable"]; | ||
export declare const fromSequence: FromSequence<ReadonlyArrayLike>["fromSequence"]; | ||
export declare const getLength: (arr: readonly unknown[]) => number; | ||
@@ -56,5 +55,1 @@ export declare const isEmpty: (arr: readonly unknown[]) => boolean; | ||
}>["toRunnable"]; | ||
export declare const toSequence: ToSequence<ReadonlyArrayLike, { | ||
readonly count?: number; | ||
readonly start?: number; | ||
}>["toSequence"]; |
@@ -20,4 +20,2 @@ import Runnable_toReadonlyArray from "../rx/Runnable/__internal__/Runnable.toReadonlyArray.js"; | ||
import ReadonlyArray_toReadonlyArray from "./ReadonlyArray/__internal__/ReadonlyArray.toReadonlyArray.js"; | ||
import ReadonlyArray_toSequence from "./ReadonlyArray/__internal__/ReadonlyArray.toSequence.js"; | ||
import Sequence_toReadonlyArray from "./Sequence/__internal__/Sequence.toReadonlyArray.js"; | ||
export const empty = ReadonlyArray_empty; | ||
@@ -33,3 +31,2 @@ export const enumerate = ReadonlyArray_enumerate; | ||
export const fromRunnable = Runnable_toReadonlyArray; | ||
export const fromSequence = Sequence_toReadonlyArray; | ||
export const getLength = ReadonlyArray_getLength; | ||
@@ -49,2 +46,1 @@ export const isEmpty = ReadonlyArray_isEmpty; | ||
export const toRunnable = ReadonlyArray_toObservable; | ||
export const toSequence = ReadonlyArray_toSequence; |
{ | ||
"name": "@reactive-js/core", | ||
"version": "0.25.0", | ||
"version": "0.26.0", | ||
"type": "module", | ||
@@ -75,3 +75,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "37139d543b933894d54003a4a92d4697d5e17b8f" | ||
"gitHead": "b738a986a23273a0c96fd865cbc61f2e9d266b2b" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Buffer, CatchError, Concat, ConcatAll, ConcatMap, ConcatWith, Contains, DecodeWithCharset, Defer, DistinctUntilChanged, Empty, EncodeUtf8, EndWith, Enumerate, EverySatisfy, First, FlatMapIterable, ForEach, ForkConcat, ForkZip, FromFactory, FromIterable, FromOptional, FromReadonlyArray, FromSequence, Generate, IgnoreElements, Keep, KeepType, Last, Map, MapTo, Pairwise, Reduce, Scan, SkipFirst, SomeSatisfy, StartWith, TakeFirst, TakeLast, TakeWhile, ThrowIfEmpty, Throws, ToReadonlyArray, Zip, ZipWith } from "../containers.js"; | ||
import { Buffer, CatchError, Concat, ConcatAll, ConcatMap, ConcatWith, Contains, DecodeWithCharset, Defer, DistinctUntilChanged, Empty, EncodeUtf8, EndWith, Enumerate, EverySatisfy, First, FlatMapIterable, ForEach, ForkConcat, ForkZip, FromFactory, FromIterable, FromOptional, FromReadonlyArray, Generate, IgnoreElements, Keep, KeepType, Last, Map, MapTo, Pairwise, Reduce, Scan, SkipFirst, SomeSatisfy, StartWith, TakeFirst, TakeLast, TakeWhile, ThrowIfEmpty, Throws, ToReadonlyArray, Zip, ZipWith } from "../containers.js"; | ||
import { EnumerableEnumeratorLike, EnumerableLike, Retry, ScanLast, ToEnumerable, ToObservable, ToRunnable } from "../rx.js"; | ||
@@ -30,3 +30,2 @@ import { ToAsyncEnumerable, ToFlowable } from "../streaming.js"; | ||
export declare const fromReadonlyArray: FromReadonlyArray<EnumerableLike>["fromReadonlyArray"]; | ||
export declare const fromSequence: FromSequence<EnumerableLike>["fromSequence"]; | ||
export declare const generate: Generate<EnumerableLike>["generate"]; | ||
@@ -33,0 +32,0 @@ export declare const ignoreElements: IgnoreElements<EnumerableLike>["ignoreElements"]; |
import Iterable_toObservable from "../containers/Iterable/__internal__/Iterable.toObservable.js"; | ||
import Optional_toObservable from "../containers/Optional/__internal__/Optional.toObservable.js"; | ||
import ReadonlyArray_toObservable from "../containers/ReadonlyArray/__internal__/ReadonlyArray.toObservable.js"; | ||
import Sequence_toObservable from "../containers/Sequence/__internal__/Sequence.toObservable.js"; | ||
import { identity, returns } from "../functions.js"; | ||
@@ -76,3 +75,2 @@ import Enumerable_catchError from "../rx/Enumerable/__internal__/Enumerable.catchError.js"; | ||
export const fromReadonlyArray = ReadonlyArray_toObservable; | ||
export const fromSequence = Sequence_toObservable; | ||
export const generate = Observable_generate; | ||
@@ -79,0 +77,0 @@ export const ignoreElements = Observable_ignoreElements; |
@@ -1,2 +0,2 @@ | ||
import { CatchError, Concat, ConcatAll, ConcatMap, ConcatWith, ContainerOperator, Contains, DecodeWithCharset, Defer, DistinctUntilChanged, Empty, EncodeUtf8, EndWith, EverySatisfy, FirstAsync, FlatMapIterable, ForEach, ForkConcat, ForkZip, FromAsyncIterable, FromFactory, FromIterable, FromOptional, FromReadonlyArray, FromSequence, Generate, IgnoreElements, Keep, KeepType, LastAsync, Map, MapTo, Never, Pairwise, Reduce, Repeat, Scan, SkipFirst, SomeSatisfy, StartWith, TakeFirst, TakeLast, TakeWhile, ThrowIfEmpty, Throws, Zip, ZipWith } from "../containers.js"; | ||
import { CatchError, Concat, ConcatAll, ConcatMap, ConcatWith, ContainerOperator, Contains, DecodeWithCharset, Defer, DistinctUntilChanged, Empty, EncodeUtf8, EndWith, EverySatisfy, FirstAsync, FlatMapIterable, ForEach, ForkConcat, ForkZip, FromAsyncIterable, FromFactory, FromIterable, FromOptional, FromReadonlyArray, Generate, IgnoreElements, Keep, KeepType, LastAsync, Map, MapTo, Never, Pairwise, Reduce, Repeat, Scan, SkipFirst, SomeSatisfy, StartWith, TakeFirst, TakeLast, TakeWhile, ThrowIfEmpty, Throws, Zip, ZipWith } from "../containers.js"; | ||
import { Factory, Function1, Function2, Function3, Function4, Function5, Function6, SideEffect, SideEffect1, SideEffect2, SideEffect3, SideEffect4, SideEffect5, SideEffect6 } from "../functions.js"; | ||
@@ -72,2 +72,5 @@ import { CombineLatest, Exhaust, ExhaustMap, ForkCombineLatest, ForkMerge, ForkZipLatest, Merge, MergeAll, MergeMap, MergeWith, ObservableLike, ObserverLike, Retry, ScanLast, SwitchAll, SwitchMap, TakeUntil, Throttle, Timeout, ToEnumerable, ToRunnable, WithLatestFrom, ZipLatest, ZipWithLatestFrom } from "../rx.js"; | ||
export declare const __using: __Using; | ||
/** | ||
* @category Operator | ||
*/ | ||
export declare const buffer: <T>(options?: { | ||
@@ -79,2 +82,5 @@ readonly duration?: number | Function1<T, ObservableLike>; | ||
export declare const combineLatest: CombineLatest<ObservableLike>["combineLatest"]; | ||
/** | ||
* @category Constructor | ||
*/ | ||
export declare const compute: <T>(computation: Factory<T>, { mode }?: { | ||
@@ -90,2 +96,5 @@ mode?: "batched" | "combine-latest" | undefined; | ||
export declare const contains: Contains<ObservableLike>["contains"]; | ||
/** | ||
* @category Constructor | ||
*/ | ||
export declare const create: <T>(f: SideEffect1<ObserverLike<T>>) => ObservableLike<T>; | ||
@@ -108,2 +117,5 @@ export declare const decodeWithCharset: DecodeWithCharset<ObservableLike>["decodeWithCharset"]; | ||
export declare const flatMapIterable: FlatMapIterable<ObservableLike>["flatMapIterable"]; | ||
/** | ||
* @category Operator | ||
*/ | ||
export declare const flatMapPromise: <TA, TB>(f: Function1<TA, Promise<TB>>) => ContainerOperator<ObservableLike<unknown>, TA, TB>; | ||
@@ -135,6 +147,2 @@ export declare const forEach: ForEach<ObservableLike>["forEach"]; | ||
}>["fromReadonlyArray"]; | ||
export declare const fromSequence: FromSequence<ObservableLike, { | ||
readonly delay?: number; | ||
readonly delayStart?: boolean; | ||
}>["fromSequence"]; | ||
export declare const generate: Generate<ObservableLike, { | ||
@@ -166,2 +174,4 @@ readonly delay?: number; | ||
* is subscribed to. | ||
* | ||
* @category Transform | ||
*/ | ||
@@ -172,2 +182,6 @@ export declare const multicast: <T>(scheduler: SchedulerLike, options?: { | ||
export declare const never: Never<ObservableLike>["never"]; | ||
export declare const observeWith: <C extends ObservableLike<unknown>, T>(observer: ObserverLike<T>) => Function1<C, C>; | ||
/** | ||
* @category Operator | ||
*/ | ||
export declare const onSubscribe: <T>(f: Factory<DisposableOrTeardown | void>) => ContainerOperator<ObservableLike, T, T>; | ||
@@ -188,2 +202,4 @@ export declare const pairwise: Pairwise<ObservableLike>["pairwise"]; | ||
* is subscribed to. | ||
* | ||
* @category Operator | ||
*/ | ||
@@ -193,3 +209,2 @@ export declare const share: <T>(scheduler: SchedulerLike, options?: { | ||
} | undefined) => Function1<ObservableLike<T>, ObservableLike<T>>; | ||
export declare const observeWith: <C extends ObservableLike<unknown>, T>(observer: ObserverLike<T>) => Function1<C, C>; | ||
export declare const skipFirst: SkipFirst<ObservableLike>["skipFirst"]; | ||
@@ -203,2 +218,5 @@ export declare const someSatisfy: SomeSatisfy<ObservableLike>["someSatisfy"]; | ||
}) => Function1<ObservableLike<T>, DisposableLike>; | ||
/** | ||
* @category Operator | ||
*/ | ||
export declare const subscribeOn: <T>(scheduler: SchedulerLike) => (observable: ObservableLike<T>) => ObservableLike<T>; | ||
@@ -205,0 +223,0 @@ export declare const takeFirst: TakeFirst<ObservableLike>["takeFirst"]; |
@@ -5,3 +5,2 @@ import AsyncIterable_toObservable from "../containers/AsyncIterable/__internal__/AsyncIterable.toObservable.js"; | ||
import ReadonlyArray_toObservable from "../containers/ReadonlyArray/__internal__/ReadonlyArray.toObservable.js"; | ||
import Sequence_toObservable from "../containers/Sequence/__internal__/Sequence.toObservable.js"; | ||
import AsyncEnumerable_toObservable from "../streaming/AsyncEnumerable/__internal__/AsyncEnumerable.toObservable.js"; | ||
@@ -114,5 +113,11 @@ import Flowable_toObservable from "../streaming/Flowable/__internal__/Flowable.toObservable.js"; | ||
export const __using = Observable_compute__using; | ||
/** | ||
* @category Operator | ||
*/ | ||
export const buffer = Observable_buffer; | ||
export const catchError = Observable_catchError; | ||
export const combineLatest = Observable_combineLatest; | ||
/** | ||
* @category Constructor | ||
*/ | ||
export const compute = Observable_compute; | ||
@@ -124,2 +129,5 @@ export const concat = Observable_concat; | ||
export const contains = Observable_contains; | ||
/** | ||
* @category Constructor | ||
*/ | ||
export const create = Observable_create; | ||
@@ -137,2 +145,5 @@ export const decodeWithCharset = Observable_decodeWithCharset; | ||
export const flatMapIterable = Observable_flatMapIterable; | ||
/** | ||
* @category Operator | ||
*/ | ||
export const flatMapPromise = Observable_flatMapPromise; | ||
@@ -152,3 +163,2 @@ export const forEach = Observable_forEach; | ||
export const fromReadonlyArray = ReadonlyArray_toObservable; | ||
export const fromSequence = Sequence_toObservable; | ||
export const generate = Observable_generate; | ||
@@ -171,5 +181,11 @@ export const ignoreElements = Observable_ignoreElements; | ||
* is subscribed to. | ||
* | ||
* @category Transform | ||
*/ | ||
export const multicast = Observable_multicast; | ||
export const never = Observable_never; | ||
export const observeWith = Observable_observeWith; | ||
/** | ||
* @category Operator | ||
*/ | ||
export const onSubscribe = Observable_onSubscribe; | ||
@@ -190,5 +206,6 @@ export const pairwise = Observable_pairwise; | ||
* is subscribed to. | ||
* | ||
* @category Operator | ||
*/ | ||
export const share = Observable_share; | ||
export const observeWith = Observable_observeWith; | ||
export const skipFirst = Observable_skipFirst; | ||
@@ -200,2 +217,5 @@ export const someSatisfy = Observable_someSatisfy; | ||
export const subscribe = Observable_subscribe; | ||
/** | ||
* @category Operator | ||
*/ | ||
export const subscribeOn = Observable_subscribeOn; | ||
@@ -202,0 +222,0 @@ export const takeFirst = Observable_takeFirst; |
@@ -11,3 +11,3 @@ import { Equality, Factory, Optional, Updater } from "../../../functions.js"; | ||
declare const Using = 4; | ||
declare const AsyncEffect_type: unique symbol; | ||
declare const ComputeEffect_type: unique symbol; | ||
declare const MemoOrUsingEffect_func: unique symbol; | ||
@@ -22,6 +22,6 @@ declare const MemoOrUsingEffect_args: unique symbol; | ||
type MemoEffect = { | ||
readonly [AsyncEffect_type]: typeof Memo; | ||
readonly [ComputeEffect_type]: typeof Memo; | ||
} & MemoOrUsingEffect; | ||
type UsingEffect = { | ||
readonly [AsyncEffect_type]: typeof Using; | ||
readonly [ComputeEffect_type]: typeof Using; | ||
[MemoOrUsingEffect_func]: (...args: any[]) => unknown; | ||
@@ -41,31 +41,31 @@ [MemoOrUsingEffect_args]: unknown[]; | ||
type ObserveEffect = { | ||
readonly [AsyncEffect_type]: typeof Observe; | ||
readonly [ComputeEffect_type]: typeof Observe; | ||
} & AwaitOrObserveEffect; | ||
type AwaitEffect = { | ||
readonly [AsyncEffect_type]: typeof Await; | ||
readonly [ComputeEffect_type]: typeof Await; | ||
} & AwaitOrObserveEffect; | ||
type AsyncEffect = AwaitEffect | MemoEffect | ObserveEffect | UsingEffect; | ||
declare const AsyncContext_index: unique symbol; | ||
declare const AsyncContext_cleanup: unique symbol; | ||
declare const AsyncContext_effects: unique symbol; | ||
declare const AsyncContext_mode: unique symbol; | ||
export declare const AsyncContext_observer: unique symbol; | ||
declare const AsyncContext_runComputation: unique symbol; | ||
declare const AsyncContext_scheduledComputationSubscription: unique symbol; | ||
export declare const AsyncContext_awaitOrObserve: unique symbol; | ||
export declare const AsyncContext_memoOrUse: unique symbol; | ||
declare class AsyncContext { | ||
[AsyncContext_index]: number; | ||
readonly [AsyncContext_effects]: AsyncEffect[]; | ||
readonly [AsyncContext_observer]: ObserverLike; | ||
private [AsyncContext_scheduledComputationSubscription]; | ||
private readonly [AsyncContext_runComputation]; | ||
private readonly [AsyncContext_mode]; | ||
private readonly [AsyncContext_cleanup]; | ||
type ComputeEffect = AwaitEffect | MemoEffect | ObserveEffect | UsingEffect; | ||
declare const ComputeContext_index: unique symbol; | ||
declare const ComputeContext_cleanup: unique symbol; | ||
declare const ComputeContext_effects: unique symbol; | ||
declare const ComputeContext_mode: unique symbol; | ||
export declare const ComputeContext_observer: unique symbol; | ||
declare const ComputeContext_runComputation: unique symbol; | ||
declare const ComputeContext_scheduledComputationSubscription: unique symbol; | ||
export declare const ComputeContext_awaitOrObserve: unique symbol; | ||
export declare const ComputeContext_memoOrUse: unique symbol; | ||
declare class ComputeContext { | ||
[ComputeContext_index]: number; | ||
readonly [ComputeContext_effects]: ComputeEffect[]; | ||
readonly [ComputeContext_observer]: ObserverLike; | ||
private [ComputeContext_scheduledComputationSubscription]; | ||
private readonly [ComputeContext_runComputation]; | ||
private readonly [ComputeContext_mode]; | ||
private readonly [ComputeContext_cleanup]; | ||
constructor(observer: ObserverLike, runComputation: () => void, mode: EffectsMode); | ||
[AsyncContext_awaitOrObserve]<T>(observable: ObservableLike<T>, shouldAwait: boolean): Optional<T>; | ||
[AsyncContext_memoOrUse]<T>(shouldUse: false, f: (...args: any[]) => T, ...args: unknown[]): T; | ||
[AsyncContext_memoOrUse]<T extends DisposableLike>(shouldUse: true, f: (...args: any[]) => T, ...args: unknown[]): T; | ||
[ComputeContext_awaitOrObserve]<T>(observable: ObservableLike<T>, shouldAwait: boolean): Optional<T>; | ||
[ComputeContext_memoOrUse]<T>(shouldUse: false, f: (...args: any[]) => T, ...args: unknown[]): T; | ||
[ComputeContext_memoOrUse]<T extends DisposableLike>(shouldUse: true, f: (...args: any[]) => T, ...args: unknown[]): T; | ||
} | ||
export declare const assertCurrentContext: () => AsyncContext; | ||
export declare const assertCurrentContext: () => ComputeContext; | ||
export declare const Observable_compute: <T>(computation: Factory<T>, { mode }?: { | ||
@@ -72,0 +72,0 @@ mode?: "batched" | "combine-latest" | undefined; |
@@ -20,3 +20,3 @@ var _a, _b, _c, _d; | ||
const Using = 4; | ||
const AsyncEffect_type = Symbol("AsyncEffect_type"); | ||
const ComputeEffect_type = Symbol("ComputeEffect_type"); | ||
const MemoOrUsingEffect_func = Symbol("MemoOrUsingEffect_func"); | ||
@@ -29,7 +29,7 @@ const MemoOrUsingEffect_args = Symbol("MemoOrUsingEffect_args"); | ||
const AwaitOrObserveEffect_hasValue = Symbol("AwaitOrObserveEffect_hasValue"); | ||
const validateAsyncEffect = ((ctx, type) => { | ||
const { [AsyncContext_effects]: effects, [AsyncContext_index]: index } = ctx; | ||
ctx[AsyncContext_index]++; | ||
const validateComputeEffect = ((ctx, type) => { | ||
const { [ComputeContext_effects]: effects, [ComputeContext_index]: index } = ctx; | ||
ctx[ComputeContext_index]++; | ||
const effect = effects[index]; | ||
if (isSome(effect) && effect[AsyncEffect_type] === type) { | ||
if (isSome(effect) && effect[ComputeEffect_type] === type) { | ||
return effect; | ||
@@ -39,4 +39,4 @@ } | ||
if (isSome(effect) && | ||
(effect[AsyncEffect_type] === Await || | ||
effect[AsyncEffect_type] === Observe)) { | ||
(effect[ComputeEffect_type] === Await || | ||
effect[ComputeEffect_type] === Observe)) { | ||
effect[AwaitOrObserveEffect_subscription][DisposableLike_dispose](); | ||
@@ -46,3 +46,3 @@ } | ||
? { | ||
[AsyncEffect_type]: type, | ||
[ComputeEffect_type]: type, | ||
[MemoOrUsingEffect_func]: ignore, | ||
@@ -54,3 +54,3 @@ [MemoOrUsingEffect_args]: [], | ||
? { | ||
[AsyncEffect_type]: type, | ||
[ComputeEffect_type]: type, | ||
[AwaitOrObserveEffect_observable]: Observable_empty(), | ||
@@ -63,3 +63,3 @@ [AwaitOrObserveEffect_subscription]: Disposable_disposed, | ||
? { | ||
[AsyncEffect_type]: type, | ||
[ComputeEffect_type]: type, | ||
[MemoOrUsingEffect_func]: ignore, | ||
@@ -81,12 +81,12 @@ [MemoOrUsingEffect_args]: [], | ||
const awaiting = error(); | ||
const AsyncContext_index = Symbol("AsyncContext_index"); | ||
const AsyncContext_cleanup = Symbol("AsyncContext_cleanup"); | ||
const AsyncContext_effects = Symbol("AsyncContext_effects"); | ||
const AsyncContext_mode = Symbol("AsyncContext_mode"); | ||
export const AsyncContext_observer = Symbol("AsyncContext_observer"); | ||
const AsyncContext_runComputation = Symbol("AsyncContext_runComputation"); | ||
const AsyncContext_scheduledComputationSubscription = Symbol("AsyncContext_scheduledComputationSubscription"); | ||
export const AsyncContext_awaitOrObserve = Symbol("AsyncContext_awaitOrObserve"); | ||
export const AsyncContext_memoOrUse = Symbol("AsyncContext_memoOrUse"); | ||
class AsyncContext { | ||
const ComputeContext_index = Symbol("ComputeContext_index"); | ||
const ComputeContext_cleanup = Symbol("ComputeContext_cleanup"); | ||
const ComputeContext_effects = Symbol("ComputeContext_effects"); | ||
const ComputeContext_mode = Symbol("ComputeContext_mode"); | ||
export const ComputeContext_observer = Symbol("ComputeContext_observer"); | ||
const ComputeContext_runComputation = Symbol("ComputeContext_runComputation"); | ||
const ComputeContext_scheduledComputationSubscription = Symbol("ComputeContext_scheduledComputationSubscription"); | ||
export const ComputeContext_awaitOrObserve = Symbol("ComputeContext_awaitOrObserve"); | ||
export const ComputeContext_memoOrUse = Symbol("ComputeContext_memoOrUse"); | ||
class ComputeContext { | ||
constructor(observer, runComputation, mode) { | ||
@@ -97,19 +97,19 @@ this[_a] = 0; | ||
this[_d] = () => { | ||
const { [AsyncContext_effects]: effects } = this; | ||
const hasOutstandingEffects = effects.findIndex(effect => (effect[AsyncEffect_type] === Await || | ||
effect[AsyncEffect_type] === Observe) && | ||
const { [ComputeContext_effects]: effects } = this; | ||
const hasOutstandingEffects = effects.findIndex(effect => (effect[ComputeEffect_type] === Await || | ||
effect[ComputeEffect_type] === Observe) && | ||
!effect[AwaitOrObserveEffect_subscription][DisposableLike_isDisposed]) >= 0; | ||
if (!hasOutstandingEffects && | ||
this[AsyncContext_scheduledComputationSubscription][DisposableLike_isDisposed]) { | ||
this[AsyncContext_observer][DisposableLike_dispose](); | ||
this[ComputeContext_scheduledComputationSubscription][DisposableLike_isDisposed]) { | ||
this[ComputeContext_observer][DisposableLike_dispose](); | ||
} | ||
}; | ||
this[AsyncContext_observer] = observer; | ||
this[AsyncContext_runComputation] = runComputation; | ||
this[AsyncContext_mode] = mode; | ||
this[ComputeContext_observer] = observer; | ||
this[ComputeContext_runComputation] = runComputation; | ||
this[ComputeContext_mode] = mode; | ||
} | ||
[(_a = AsyncContext_index, _b = AsyncContext_effects, _c = AsyncContext_scheduledComputationSubscription, _d = AsyncContext_cleanup, AsyncContext_awaitOrObserve)](observable, shouldAwait) { | ||
[(_a = ComputeContext_index, _b = ComputeContext_effects, _c = ComputeContext_scheduledComputationSubscription, _d = ComputeContext_cleanup, ComputeContext_awaitOrObserve)](observable, shouldAwait) { | ||
const effect = shouldAwait | ||
? validateAsyncEffect(this, Await) | ||
: validateAsyncEffect(this, Observe); | ||
? validateComputeEffect(this, Await) | ||
: validateComputeEffect(this, Observe); | ||
if (effect[AwaitOrObserveEffect_observable] === observable) { | ||
@@ -120,3 +120,3 @@ return effect[AwaitOrObserveEffect_value]; | ||
effect[AwaitOrObserveEffect_subscription][DisposableLike_dispose](); | ||
const { [AsyncContext_observer]: observer, [AsyncContext_runComputation]: runComputation, } = this; | ||
const { [ComputeContext_observer]: observer, [ComputeContext_runComputation]: runComputation, } = this; | ||
const scheduler = observer[DispatcherLike_scheduler]; | ||
@@ -126,8 +126,8 @@ const subscription = pipe(observable, Observable_forEach(next => { | ||
effect[AwaitOrObserveEffect_hasValue] = true; | ||
if (this[AsyncContext_mode] === "combine-latest") { | ||
if (this[ComputeContext_mode] === "combine-latest") { | ||
runComputation(); | ||
} | ||
else { | ||
let { [AsyncContext_scheduledComputationSubscription]: scheduledComputationSubscription, } = this; | ||
this[AsyncContext_scheduledComputationSubscription] = | ||
let { [ComputeContext_scheduledComputationSubscription]: scheduledComputationSubscription, } = this; | ||
this[ComputeContext_scheduledComputationSubscription] = | ||
scheduledComputationSubscription[DisposableLike_isDisposed] | ||
@@ -137,3 +137,3 @@ ? pipe(observer, Observer_schedule(runComputation)) | ||
} | ||
}), Observable_subscribe(scheduler), Disposable_addTo(observer), Disposable_onComplete(this[AsyncContext_cleanup])); | ||
}), Observable_subscribe(scheduler), Disposable_addTo(observer), Disposable_onComplete(this[ComputeContext_cleanup])); | ||
effect[AwaitOrObserveEffect_observable] = observable; | ||
@@ -146,6 +146,6 @@ effect[AwaitOrObserveEffect_subscription] = subscription; | ||
} | ||
[AsyncContext_memoOrUse](shouldUse, f, ...args) { | ||
[ComputeContext_memoOrUse](shouldUse, f, ...args) { | ||
const effect = shouldUse | ||
? validateAsyncEffect(this, Using) | ||
: validateAsyncEffect(this, Memo); | ||
? validateComputeEffect(this, Using) | ||
: validateComputeEffect(this, Memo); | ||
if (f === effect[MemoOrUsingEffect_func] && | ||
@@ -164,3 +164,3 @@ arrayStrictEquality(args, effect[MemoOrUsingEffect_args])) { | ||
if (shouldUse) { | ||
pipe(value, Disposable_addTo(this[AsyncContext_observer])); | ||
pipe(value, Disposable_addTo(this[ComputeContext_observer])); | ||
} | ||
@@ -190,9 +190,9 @@ return value; | ||
} | ||
const { [AsyncContext_effects]: effects } = ctx; | ||
if (ReadonlyArray_getLength(effects) > ctx[AsyncContext_index]) { | ||
const { [ComputeContext_effects]: effects } = ctx; | ||
if (ReadonlyArray_getLength(effects) > ctx[ComputeContext_index]) { | ||
const effectsLength = effects.length; | ||
for (let i = ctx[AsyncContext_index]; i < effectsLength; i++) { | ||
const effect = ctx[AsyncContext_effects][i]; | ||
if (effect[AsyncEffect_type] === Await || | ||
effect[AsyncEffect_type] === Observe) { | ||
for (let i = ctx[ComputeContext_index]; i < effectsLength; i++) { | ||
const effect = ctx[ComputeContext_effects][i]; | ||
if (effect[ComputeEffect_type] === Await || | ||
effect[ComputeEffect_type] === Observe) { | ||
effect[AwaitOrObserveEffect_subscription][DisposableLike_dispose](); | ||
@@ -202,5 +202,5 @@ } | ||
} | ||
ctx[AsyncContext_effects].length = ctx[AsyncContext_index]; | ||
ctx[ComputeContext_effects].length = ctx[ComputeContext_index]; | ||
currentCtx = none; | ||
ctx[AsyncContext_index] = 0; | ||
ctx[ComputeContext_index] = 0; | ||
const effectsLength = ReadonlyArray_getLength(effects); | ||
@@ -212,3 +212,3 @@ // Inline this for perf | ||
const effect = effects[i]; | ||
const { [AsyncEffect_type]: type } = effect; | ||
const { [ComputeEffect_type]: type } = effect; | ||
if ((type === Await || type === Observe) && | ||
@@ -241,3 +241,3 @@ !effect[AwaitOrObserveEffect_hasValue]) { | ||
}; | ||
const ctx = newInstance(AsyncContext, observer, runComputation, mode); | ||
const ctx = newInstance(ComputeContext, observer, runComputation, mode); | ||
pipe(observer, Observer_schedule(runComputation)); | ||
@@ -247,11 +247,11 @@ }); | ||
const ctx = assertCurrentContext(); | ||
return ctx[AsyncContext_memoOrUse](false, f, ...args); | ||
return ctx[ComputeContext_memoOrUse](false, f, ...args); | ||
}; | ||
export const Observable_compute__await = (observable) => { | ||
const ctx = assertCurrentContext(); | ||
return ctx[AsyncContext_awaitOrObserve](observable, true); | ||
return ctx[ComputeContext_awaitOrObserve](observable, true); | ||
}; | ||
export const Observable_compute__observe = (observable) => { | ||
const ctx = assertCurrentContext(); | ||
return ctx[AsyncContext_awaitOrObserve](observable, false); | ||
return ctx[ComputeContext_awaitOrObserve](observable, false); | ||
}; | ||
@@ -269,6 +269,6 @@ export const Observable_compute__do = /*@__PURE__*/ (() => { | ||
const ctx = assertCurrentContext(); | ||
const scheduler = ctx[AsyncContext_observer][DispatcherLike_scheduler]; | ||
const observable = ctx[AsyncContext_memoOrUse](false, deferSideEffect, f, ...args); | ||
const subscribeOnScheduler = ctx[AsyncContext_memoOrUse](false, Observable_subscribe, scheduler); | ||
ctx[AsyncContext_memoOrUse](true, subscribeOnScheduler, observable); | ||
const scheduler = ctx[ComputeContext_observer][DispatcherLike_scheduler]; | ||
const observable = ctx[ComputeContext_memoOrUse](false, deferSideEffect, f, ...args); | ||
const subscribeOnScheduler = ctx[ComputeContext_memoOrUse](false, Observable_subscribe, scheduler); | ||
ctx[ComputeContext_memoOrUse](true, subscribeOnScheduler, observable); | ||
}; | ||
@@ -278,7 +278,7 @@ })(); | ||
const ctx = assertCurrentContext(); | ||
return ctx[AsyncContext_memoOrUse](true, f, ...args); | ||
return ctx[ComputeContext_memoOrUse](true, f, ...args); | ||
}; | ||
export function Observable_compute__currentScheduler() { | ||
const ctx = assertCurrentContext(); | ||
return ctx[AsyncContext_observer][DispatcherLike_scheduler]; | ||
return ctx[ComputeContext_observer][DispatcherLike_scheduler]; | ||
} | ||
@@ -285,0 +285,0 @@ export const Observable_compute__stream = /*@__PURE__*/ (() => { |
@@ -1,2 +0,2 @@ | ||
import { Buffer, CatchError, Concat, ConcatAll, ConcatMap, ConcatWith, Contains, DecodeWithCharset, Defer, DistinctUntilChanged, Empty, EncodeUtf8, EndWith, EverySatisfy, First, FlatMapIterable, ForEach, ForkConcat, ForkZip, FromFactory, FromIterable, FromOptional, FromReadonlyArray, FromSequence, Generate, IgnoreElements, Keep, KeepType, Last, Map, MapTo, Pairwise, Reduce, Scan, SkipFirst, SomeSatisfy, StartWith, TakeFirst, TakeLast, TakeWhile, ThrowIfEmpty, Throws, ToReadonlyArray, Zip, ZipWith } from "../containers.js"; | ||
import { Buffer, CatchError, Concat, ConcatAll, ConcatMap, ConcatWith, Contains, DecodeWithCharset, Defer, DistinctUntilChanged, Empty, EncodeUtf8, EndWith, EverySatisfy, First, FlatMapIterable, ForEach, ForkConcat, ForkZip, FromFactory, FromIterable, FromOptional, FromReadonlyArray, Generate, IgnoreElements, Keep, KeepType, Last, Map, MapTo, Pairwise, Reduce, Scan, SkipFirst, SomeSatisfy, StartWith, TakeFirst, TakeLast, TakeWhile, ThrowIfEmpty, Throws, ToReadonlyArray, Zip, ZipWith } from "../containers.js"; | ||
import { CombineLatest, Exhaust, ExhaustMap, ForkMerge, ForkZipLatest, FromEnumerable, Merge, MergeAll, MergeWith, Retry, RunnableLike, ScanLast, SwitchAll, SwitchMap, TakeUntil, Throttle, Timeout, ToEnumerable, ToObservable, ToRunnable, WithLatestFrom, ZipLatest, ZipWithLatestFrom } from "../rx.js"; | ||
@@ -50,3 +50,2 @@ import { ToFlowable } from "../streaming.js"; | ||
}>["fromReadonlyArray"]; | ||
export declare const fromSequence: FromSequence<RunnableLike>["fromSequence"]; | ||
export declare const generate: Generate<RunnableLike, { | ||
@@ -53,0 +52,0 @@ readonly delay?: number; |
import Iterable_toObservable from "../containers/Iterable/__internal__/Iterable.toObservable.js"; | ||
import Optional_toObservable from "../containers/Optional/__internal__/Optional.toObservable.js"; | ||
import ReadonlyArray_toObservable from "../containers/ReadonlyArray/__internal__/ReadonlyArray.toObservable.js"; | ||
import Sequence_toObservable from "../containers/Sequence/__internal__/Sequence.toObservable.js"; | ||
import { identity, returns } from "../functions.js"; | ||
@@ -97,3 +96,2 @@ import Observable_buffer from "./Observable/__internal__/Observable.buffer.js"; | ||
export const fromReadonlyArray = ReadonlyArray_toObservable; | ||
export const fromSequence = Sequence_toObservable; | ||
export const generate = Observable_generate; | ||
@@ -100,0 +98,0 @@ export const ignoreElements = Observable_ignoreElements; |
@@ -1,2 +0,2 @@ | ||
import { FromAsyncIterable, FromIterable, FromOptional, FromReadonlyArray, FromSequence, Generate, Keep, Map, Scan, TakeWhile } from "../containers.js"; | ||
import { FromAsyncIterable, FromIterable, FromOptional, FromReadonlyArray, Generate, Keep, Map, Scan, TakeWhile } from "../containers.js"; | ||
import { FromEnumerable, GenerateLast, ObservableLike, ScanLast, ToEnumerable, ToObservable, ToRunnable } from "../rx.js"; | ||
@@ -16,3 +16,2 @@ import { AsyncEnumerableLike } from "../streaming.js"; | ||
}>["fromReadonlyArray"]; | ||
export declare const fromSequence: FromSequence<AsyncEnumerableLike>["fromSequence"]; | ||
export declare const generate: Generate<AsyncEnumerableLike, { | ||
@@ -19,0 +18,0 @@ delay: number; |
@@ -5,3 +5,2 @@ import AsyncIterable_toAsyncEnumerable from "../containers/AsyncIterable/__internal__/AsyncIterable.toAsyncEnumerable.js"; | ||
import ReadonlyArray_toAsyncEnumerable from "../containers/ReadonlyArray/__internal__/ReadonlyArray.toAsyncEnumerable.js"; | ||
import Sequence_toAsyncEnumerable from "../containers/Sequence/__internal__/Sequence.toAsyncEnumerable.js"; | ||
import Enumerable_toAsyncEnumerable from "../rx/Enumerable/__internal__/Enumerable.toAsyncEnumerable.js"; | ||
@@ -23,3 +22,2 @@ import AsyncEnumerable_generate from "./AsyncEnumerable/__internal__/AsyncEnumerable.generate.js"; | ||
export const fromReadonlyArray = ReadonlyArray_toAsyncEnumerable; | ||
export const fromSequence = Sequence_toAsyncEnumerable; | ||
export const generate = AsyncEnumerable_generate; | ||
@@ -26,0 +24,0 @@ export const generateLast = AsyncEnumerable_generateLast; |
@@ -1,2 +0,2 @@ | ||
import { FromAsyncIterable, FromIterable, FromOptional, FromReadonlyArray, FromSequence } from "../containers.js"; | ||
import { FromAsyncIterable, FromIterable, FromOptional, FromReadonlyArray } from "../containers.js"; | ||
import { FromEnumerable, FromRunnable, ToObservable, ToRunnable } from "../rx.js"; | ||
@@ -17,4 +17,3 @@ import { FlowableLike } from "../streaming.js"; | ||
export declare const fromRunnable: FromRunnable<FlowableLike>["fromRunnable"]; | ||
export declare const fromSequence: FromSequence<FlowableLike>["fromSequence"]; | ||
export declare const toObservable: ToObservable<FlowableLike>["toObservable"]; | ||
export declare const toRunnable: ToRunnable<FlowableLike>["toRunnable"]; |
@@ -5,3 +5,2 @@ import AsyncIterable_toFlowable from "../containers/AsyncIterable/__internal__/AsyncIterable.toFlowable.js"; | ||
import ReadonlyArray_toFlowable from "../containers/ReadonlyArray/__internal__/ReadonlyArray.toFlowable.js"; | ||
import Sequence_toFlowable from "../containers/Sequence/__internal__/Sequence.toFlowable.js"; | ||
import Runnable_toFlowable from "../rx/Runnable/__internal__/Runnable.toFlowable.js"; | ||
@@ -16,4 +15,3 @@ import Flowable_toObservable from "./Flowable/__internal__/Flowable.toObservable.js"; | ||
export const fromRunnable = Runnable_toFlowable; | ||
export const fromSequence = Sequence_toFlowable; | ||
export const toObservable = Flowable_toObservable; | ||
export const toRunnable = Flowable_toRunnable; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
549164
529
9989