Module

RxJS.AsyncSubject

Package
purescript-rxjs
Repository
jasonzoladz/purescript-rxjs

#observeOn Source

observeOn :: forall a. Scheduler -> AsyncSubject a -> AsyncSubject a

Makes every next call run in the new Scheduler.

#subscribeOn Source

subscribeOn :: forall a. Scheduler -> AsyncSubject a -> AsyncSubject a

Makes subscription happen on a given Scheduler.

#subscribe Source

subscribe :: forall e a. Subscriber a -> AsyncSubject a -> Eff e Subscription

Subscribing to an AsyncSubject is like calling a function, providing next, error and completed effects to which the data will be delivered.

#subscribeNext Source

subscribeNext :: forall e a. (a -> Eff e Unit) -> AsyncSubject a -> Eff e Subscription

#just Source

just :: forall a. a -> AsyncSubject a

Creates an AsyncSubject that emits the value specify, and then emits a complete notification. An alias for of.

#asObservable Source

asObservable :: forall a. AsyncSubject a -> Observable a

Create an Observable from a AsyncSubject

#buffer Source

buffer :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject (Array a)

Collects values from the first AsyncSubject into an Array, and emits that array only when second AsyncSubject emits.

#bufferCount Source

bufferCount :: forall a. Int -> Int -> AsyncSubject a -> AsyncSubject (Array a)

Collects values from the past as an array, emits that array when its size (arg1) reaches the specified buffer size, and starts a new buffer. The new buffer starts with nth (arg2) element of the AsyncSubject counting from the beginning of the last buffer.

#bufferToggle Source

bufferToggle :: forall c b a. (AsyncSubject a) -> (AsyncSubject b) -> (b -> AsyncSubject c) -> (AsyncSubject (Array a))

Collects values from the source AsyncSubject (arg1) as an array. Starts collecting only when the opening (arg2) AsyncSubject emits, and calls the closingSelector function (arg3) to get an AsyncSubject that decides when to close the buffer. Another buffer opens when the opening AsyncSubject emits its next value.

#bufferWhen Source

bufferWhen :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject (Array a)

Collects values from the past as an array. When it starts collecting values, it calls a function that returns an AsyncSubject that emits to close the buffer and restart collecting.

#concatMap Source

concatMap :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject b

Equivalent to mergeMap (a.k.a, >>=) EXCEPT that, unlike mergeMap, the next bind will not run until the AsyncSubject generated by the projection function (arg2) completes. That is, composition is sequential, not concurrent. Warning: if source values arrive endlessly and faster than their corresponding inner AsyncSubjects can complete, it will result in memory issues as inner AsyncSubjects amass in an unbounded buffer waiting for their turn to be subscribed to.

#concatMapTo Source

concatMapTo :: forall c b a. AsyncSubject a -> AsyncSubject b -> (a -> b -> AsyncSubject c) -> AsyncSubject c

The type signature explains it best. Warning: Like concatMap, composition is sequential.

#every Source

every :: forall a. AsyncSubject a -> (a -> Boolean) -> AsyncSubject Boolean

Determines whether all elements of an AsyncSubject satisfy a condition. Returns an AsyncSubject containing a single element determining whether all elements in the source AsyncSubject pass the test in the specified predicate.

#exhaustMap Source

exhaustMap :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject b

It's Like concatMap (a.k.a, >>=) EXCEPT that it ignores every new projected AsyncSubject if the previous projected AsyncSubject has not yet completed.

#expand Source

expand :: forall a. AsyncSubject a -> (a -> AsyncSubject a) -> AsyncSubject a

It's similar to mergeMap, but applies the projection function to every source value as well as every output value. It's recursive.

#groupBy Source

groupBy :: forall b a. (a -> b) -> AsyncSubject a -> AsyncSubject (AsyncSubject a)

Groups the items emitted by an AsyncSubject (arg2) according to the value returned by the grouping function (arg1). Each group becomes its own AsyncSubject.

#mapTo Source

mapTo :: forall b a. b -> AsyncSubject a -> AsyncSubject b

Emits the given constant value on the output AsyncSubject every time the source AsyncSubject emits a value.

#mergeMap Source

mergeMap :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject b

Maps each value to an AsyncSubject, then flattens all of these AsyncSubjects using mergeAll. It's just monadic bind.

#mergeMapTo Source

mergeMapTo :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject b

Maps each value of the AsyncSubject (arg1) to the same inner AsyncSubject (arg2), then flattens the result.

#pairwise Source

pairwise :: forall a. AsyncSubject a -> AsyncSubject (Array a)

Puts the current value and previous value together as an array, and emits that.

#partition Source

partition :: forall a. (a -> Boolean) -> AsyncSubject a -> Array (AsyncSubject a)

Given a predicate function (arg1), and an AsyncSubject (arg2), it outputs a two element array of partitioned values (i.e., [ AsyncSubject valuesThatPassPredicate, AsyncSubject valuesThatFailPredicate ]).

#scan Source

scan :: forall b a. (a -> b -> b) -> b -> AsyncSubject a -> AsyncSubject b

Given an accumulator function (arg1), an initial value (arg2), and a source AsyncSubject (arg3), it returns an AsyncSubject that emits the current accumlation whenever the source emits a value.

#switchMap Source

switchMap :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject b

Projects each source value to an AsyncSubject which is merged in the output AsyncSubject, emitting values only from the most recently projected AsyncSubject.

#switchMapTo Source

switchMapTo :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject b

It's like switchMap, but maps each value to the same inner AsyncSubject.

#window Source

window :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject (AsyncSubject a)

It's like buffer, but emits a nested AsyncSubject instead of an array.

#windowCount Source

windowCount :: forall a. Int -> Int -> AsyncSubject a -> AsyncSubject (AsyncSubject a)

It's like bufferCount, but emits a nested AsyncSubject instead of an array.

#windowTime Source

windowTime :: forall a. Int -> Int -> AsyncSubject a -> AsyncSubject (AsyncSubject a)

It's like bufferTime, but emits a nested AsyncSubject instead of an array, and it doesn't take a maximum size parameter. arg1 is how long to buffer items into a new AsyncSubject, arg2 is the when the next buffer should begin, and arg3 is the source AsyncSubject.

#windowToggle Source

windowToggle :: forall c b a. (AsyncSubject a) -> (AsyncSubject b) -> (b -> AsyncSubject c) -> (AsyncSubject (Array a))

It's like bufferToggle, but emits a nested AsyncSubject instead of an array.

#windowWhen Source

windowWhen :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject (AsyncSubject a)

It's like bufferWhen, but emits a nested AsyncSubject instead of an array.

#audit Source

audit :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject a

It's like auditTime, but the silencing duration is determined by a second AsyncSubject.

#auditTime Source

auditTime :: forall a. Int -> AsyncSubject a -> AsyncSubject a

Ignores source values for duration milliseconds, then emits the most recent value from the source AsyncSubject, then repeats this process.

#debounce Source

debounce :: forall a. AsyncSubject a -> (a -> AsyncSubject Int) -> AsyncSubject a

It's like debounceTime, but the time span of emission silence is determined by a second AsyncSubject. Allows for a variable debounce rate.

#debounceTime Source

debounceTime :: forall a. Int -> AsyncSubject a -> AsyncSubject a

It's like delay, but passes only the most recent value from each burst of emissions.

#distinct Source

distinct :: forall a. AsyncSubject a -> AsyncSubject a

Returns an AsyncSubject that emits all items emitted by the source AsyncSubject that are distinct by comparison from previous items.

#distinctUntilChanged Source

distinctUntilChanged :: forall a. AsyncSubject a -> AsyncSubject a

Returns an AsyncSubject that emits all items emitted by the source AsyncSubject that are distinct by comparison from the previous item.

#elementAt Source

elementAt :: forall a. AsyncSubject a -> Int -> AsyncSubject a

Emits the single value at the specified index in a sequence of emissions from the source AsyncSubject.

#filter Source

filter :: forall a. (a -> Boolean) -> AsyncSubject a -> AsyncSubject a

Filter items emitted by the source AsyncSubject by only emitting those that satisfy a specified predicate.

#ignoreElements Source

ignoreElements :: forall a. AsyncSubject a -> AsyncSubject a

Ignores all items emitted by the source AsyncSubject and only passes calls of complete or error.

#last Source

last :: forall a. AsyncSubject a -> AsyncSubject a

Returns an AsyncSubject that emits only the last item emitted by the source AsyncSubject.

#sample Source

sample :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject a

It's like sampleTime, but samples whenever the notifier AsyncSubject emits something.

#sampleTime Source

sampleTime :: forall a. Int -> AsyncSubject a -> AsyncSubject a

Periodically looks at the source AsyncSubject and emits whichever value it has most recently emitted since the previous sampling, unless the source has not emitted anything since the previous sampling.

#skip Source

skip :: forall a. Int -> AsyncSubject a -> AsyncSubject a

Returns an AsyncSubject that skips n items emitted by an AsyncSubject.

#skipUntil Source

skipUntil :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject a

Returns an AsyncSubject that skips items emitted by the source AsyncSubject until a second AsyncSubject emits an item.

#skipWhile Source

skipWhile :: forall a. (a -> Boolean) -> AsyncSubject a -> AsyncSubject a

Returns an AsyncSubject that skips all items emitted by the source AsyncSubject as long as a specified condition holds true, but emits all further source items as soon as the condition becomes false.

#take Source

take :: forall a. Int -> AsyncSubject a -> AsyncSubject a

Emits only the first n values emitted by the source AsyncSubject.

#takeUntil Source

takeUntil :: forall b a. AsyncSubject a -> AsyncSubject b -> AsyncSubject a

Lets values pass until a second AsyncSubject emits something. Then, it completes.

#takeWhile Source

takeWhile :: forall a. (a -> Boolean) -> AsyncSubject a -> AsyncSubject a

Emits values emitted by the source AsyncSubject so long as each value satisfies the given predicate, and then completes as soon as this predicate is not satisfied.

#throttle Source

throttle :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject a

It's like throttleTime, but the silencing duration is determined by a second AsyncSubject.

#throttleTime Source

throttleTime :: forall a. Int -> AsyncSubject a -> AsyncSubject a

Emits a value from the source AsyncSubject, then ignores subsequent source values for duration milliseconds, then repeats this process.

#combineLatest Source

combineLatest :: forall c b a. (a -> b -> c) -> AsyncSubject a -> AsyncSubject b -> AsyncSubject c

An AsyncSubject of projected values from the most recent values from each input AsyncSubject.

#concat Source

concat :: forall a. AsyncSubject a -> AsyncSubject a -> AsyncSubject a

Concatenates two AsyncSubjects together by sequentially emitting their values, one AsyncSubject after the other.

#concatAll Source

concatAll :: forall a. AsyncSubject (AsyncSubject a) -> AsyncSubject a

Converts a higher-order AsyncSubject into a first-order AsyncSubject by concatenating the inner AsyncSubjects in order.

#exhaust Source

exhaust :: forall a. AsyncSubject (AsyncSubject a) -> AsyncSubject a

Flattens an AsyncSubject-of-AsyncSubjects by dropping the next inner AsyncSubjects while the current inner is still executing.

#merge Source

merge :: forall a. AsyncSubject a -> AsyncSubject a -> AsyncSubject a

Creates an output AsyncSubject which concurrently emits all values from each input AsyncSubject.

#mergeAll Source

mergeAll :: forall a. AsyncSubject (AsyncSubject a) -> AsyncSubject a

Converts a higher-order AsyncSubject into a first-order AsyncSubject which concurrently delivers all values that are emitted on the inner AsyncSubjects.

#race Source

race :: forall a. Array (AsyncSubject a) -> AsyncSubject a

Returns an AsyncSubject that mirrors the first source AsyncSubject to emit an item from the array of AsyncSubjects.

#startWith Source

startWith :: forall a. Array a -> AsyncSubject a -> AsyncSubject a

Returns an AsyncSubject that emits the items in the given Array before it begins to emit items emitted by the source AsyncSubject.

#withLatestFrom Source

withLatestFrom :: forall c b a. (a -> b -> c) -> AsyncSubject a -> AsyncSubject b -> AsyncSubject c

Combines each value from the source AsyncSubjects using a project function to determine the value to be emitted on the output AsyncSubject.

#zip Source

zip :: forall a. Array (AsyncSubject a) -> AsyncSubject (Array a)

Waits for each AsyncSubject to emit a value. Once this occurs, all values with the corresponding index will be emitted. This will continue until at least one inner AsyncSubject completes.

#catch Source

catch :: forall a. (AsyncSubject a) -> (Error -> AsyncSubject a) -> (AsyncSubject a)

#retry Source

retry :: forall a. Int -> AsyncSubject a -> AsyncSubject a

If the source AsyncSubject calls error, this method will resubscribe to the source AsyncSubject n times rather than propagating the error call.

#delay Source

delay :: forall a. Int -> AsyncSubject a -> AsyncSubject a

Time shifts each item by some specified amount of milliseconds.

#delayWhen Source

delayWhen :: forall b a. AsyncSubject a -> (a -> AsyncSubject b) -> AsyncSubject a

Delays the emission of items from the source AsyncSubject by a given time span determined by the emissions of another AsyncSubject.

#dematerialize Source

#materialize Source

#performEach Source

performEach :: forall e a. AsyncSubject a -> (a -> Eff e Unit) -> Eff e (AsyncSubject a)

Performs the effect on each value of the AsyncSubject. An alias for do. Useful for testing (transparently performing an effect outside of a subscription).

#toArray Source

toArray :: forall a. AsyncSubject a -> AsyncSubject (Array a)

#count Source

count :: forall a. AsyncSubject a -> AsyncSubject Int

Counts the number of emissions on the source and emits that number when the source completes.