# cp.rx.go.Given

A Statement that will execute the provided resolvable values. This will resolve the provided values into Observables and pass on the first result of each to the next stage as individual parameters. This will continue until one of the Observables has completed, at which point other results from values are ignored.


# Submodules


# API Overview

Constructors - API calls which return an object, typically one that offers API methods

  • Given

Methods - API calls which can only be made on an object returned by a constructor

  • Then

# API Documentation

# Constructors

# Given

Signature cp.rx.go.Given(...) -> Given
Type Constructor
Description Begins the definition of a Given Statement.
Parameters
  • ... - the list of resolvable values to evaluate.
Returns
  • A new Given Statement instance.
Notes
  • This will resolve the provided values into Observables and pass on the
  • first result of each to the next stage as individual parameters.
  • This will continue until one of the Observables has completed, at which
  • point other results from values are ignored.
  • For example:
  • lua</li><li>Given(Observable.of(1, 2, 3), Observable.of("a", "b"))</li><li>:Now(function(number, letter) print(tostring(number)..letter))</li><li>
  • This will result in:
  • </li><li>1a</li><li>2b</li><li>
  • For more power, you can add a Then to futher modify the results, or chain other operations.
  • See the Given.Then documentation for details.
Examples None
Source src/extensions/cp/rx/go/Given.lua line 18

# Methods

# Then

Signature cp.rx.go.Given:Then(...) -> Given.Then
Type Method
Description Call this to define what will happen once the Given values resolve successfully.
Parameters
  • ... - The list of resolveable values to process for each Given result.
Returns
Notes
  • The parameters can be any 'resolvable' type.
  • If a parameter is a function, it will be passed the results of the previous Given or Then parameters.
  • For example:
  • lua</li><li>Given(anObservable, anotherObservable)</li><li>:Then(function(aResult, anotherResult)</li><li> doSomethingWith(aResult, anotherResult)</li><li> return true</li><li>end)</li><li>
Examples None
Source src/extensions/cp/rx/go/Given.lua line 77