Module

RxJS.ReplaySubject

Package
purescript-rxjs
Repository
jasonzoladz/purescript-rxjs

#observeOn Source

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

Makes every next call run in the new Scheduler.

#subscribeOn Source

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

Makes subscription happen on a given Scheduler.

#subscribe Source

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

Subscribing to an ReplaySubject 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) -> ReplaySubject a -> Eff e Subscription

#just Source

just :: forall a. a -> ReplaySubject a

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

#next Source

next :: forall e a. a -> ReplaySubject a -> Eff e Unit

Send a new value to a ReplaySubject

#send Source

send :: forall e a. a -> ReplaySubject a -> Eff e Unit

An alias for next

#asObservable Source

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

Create an Observable from a ReplaySubject

#buffer Source

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

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

#bufferCount Source

bufferCount :: forall a. Int -> Int -> ReplaySubject a -> ReplaySubject (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 ReplaySubject counting from the beginning of the last buffer.

#bufferToggle Source

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

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

#bufferWhen Source

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

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

#concatMap Source

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

Equivalent to mergeMap (a.k.a, >>=) EXCEPT that, unlike mergeMap, the next bind will not run until the ReplaySubject 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 ReplaySubjects can complete, it will result in memory issues as inner ReplaySubjects amass in an unbounded buffer waiting for their turn to be subscribed to.

#concatMapTo Source

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

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

#exhaustMap Source

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

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

#expand Source

expand :: forall a. ReplaySubject a -> (a -> ReplaySubject a) -> ReplaySubject 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) -> ReplaySubject a -> ReplaySubject (ReplaySubject a)

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

#mapTo Source

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

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

#mergeMap Source

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

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

#mergeMapTo Source

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

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

#pairwise Source

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

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

#partition Source

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

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

#scan Source

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

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

#switchMap Source

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

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

#switchMapTo Source

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

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

#window Source

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

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

#windowCount Source

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

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

#windowTime Source

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

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

#windowToggle Source

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

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

#windowWhen Source

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

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

#audit Source

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

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

#auditTime Source

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

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

#debounce Source

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

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

#debounceTime Source

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

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

#distinct Source

distinct :: forall a. ReplaySubject a -> ReplaySubject a

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

#distinctUntilChanged Source

distinctUntilChanged :: forall a. ReplaySubject a -> ReplaySubject a

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

#elementAt Source

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

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

#filter Source

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

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

#ignoreElements Source

ignoreElements :: forall a. ReplaySubject a -> ReplaySubject a

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

#last Source

last :: forall a. ReplaySubject a -> ReplaySubject a

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

#sample Source

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

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

#sampleTime Source

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

Periodically looks at the source ReplaySubject 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 -> ReplaySubject a -> ReplaySubject a

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

#skipUntil Source

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

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

#skipWhile Source

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

Returns an ReplaySubject that skips all items emitted by the source ReplaySubject 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 -> ReplaySubject a -> ReplaySubject a

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

#takeUntil Source

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

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

#takeWhile Source

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

Emits values emitted by the source ReplaySubject 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. ReplaySubject a -> (a -> ReplaySubject b) -> ReplaySubject a

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

#throttleTime Source

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

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

#combineLatest Source

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

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

#concat Source

concat :: forall a. ReplaySubject a -> ReplaySubject a -> ReplaySubject a

Concatenates two ReplaySubjects together by sequentially emitting their values, one ReplaySubject after the other.

#concatAll Source

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

Converts a higher-order ReplaySubject into a first-order ReplaySubject by concatenating the inner ReplaySubjects in order.

#exhaust Source

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

Flattens an ReplaySubject-of-ReplaySubjects by dropping the next inner ReplaySubjects while the current inner is still executing.

#merge Source

merge :: forall a. ReplaySubject a -> ReplaySubject a -> ReplaySubject a

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

#mergeAll Source

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

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

#race Source

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

Returns an ReplaySubject that mirrors the first source ReplaySubject to emit an item from the array of ReplaySubjects.

#startWith Source

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

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

#withLatestFrom Source

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

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

#zip Source

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

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

#catch Source

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

#retry Source

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

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

#delay Source

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

Time shifts each item by some specified amount of milliseconds.

#delayWhen Source

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

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

#dematerialize Source

#performEach Source

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

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

#toArray Source

#count Source

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

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