Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

API Documentation

Constructors

Interfaces

Utilities

Operators

  • com.industry.rx_epl.operators.*

All of the standard operators (except publish, connect, refCount, share...) can be used in two ways:

Chaining - Accessible from the IObservable interface.

Observable.fromValues([1,2,3])
	.map(multiplyBy10)
	.reduce(sumValues)
	...

Piping - Accessible via the com.industry.rx_epl.operators.* sub-package, and used via the .let(...) and .pipe(...) operators.

using com.industry.rx_epl.operators.Map;
using com.industry.rx_epl.operators.Reduce;

Observable.fromValues([1,2,3])
	.let(Map.create(multiplyBy10))
	.let(Reduce.create(sumValues))
	...

Observable.fromValues([1,2,3])
	.pipe([
		Map.create(multiplyBy10),
		Reduce.create(sumValues)
	])
	...

For a list of operators see: IObservable

Wildcard Class Notation

In the API documentation you will see notation like:

  • action<T> returns T

This means any of the following would be acceptable:

  • action<integer> returns integer
  • action<float> returns float
  • action<string> returns string

But, the following would not be acceptable:

  • action<float> returns integer

However, it would be acceptable if the definition was:

  • action<T1> returns T2

In practice this is frequently used with any operators that take actions:

.map(action<value: T1> returns T2) returns IObservable<T2>

Here we can see that map takes an argument which is an action. The action must have 1 argument (of any type) and return a value (of any type). The return type of the action determines the return type of the IObservable.

As such, any action that meets the criteria is an acceptable action to use with the map operator:

action multiplyIntegerBy10(integer value) returns integer {
  return value * 10;
}
action convertValueToString(any value) returns string {
  return value.valueToString();
}

This is possible because the real method signature of .map(...) is:

.map(any) returns IObservable

However, there are strict runtime checks to make sure you don't provide anything invalid (eg. a string).