1.0.8 • Published 5 years ago

@finch/values v1.0.8

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
5 years ago

:books: All guides and package documentation.


@finch/values

:bird: Stability: 2 - Stable (added in 1.0.0)

Utility operator that yields static values then completes. This operator is typically used to feed static values to a stream during development.

Installation

npm install -g @finch/values

:bird: Omit -g flag to install within the current directory.

Params

  • delay: time in milliseconds to wait between values. This allows for yielding values on an interval.
  • times: number of times to yield values. Use -1 to repeat indefinitely. Default value is 1.
  • values: any iterable value. Typically this will be an array of values. The values should always be JSON serializable.

Examples

Yields 42 once then complete:

{ "use": "@finch/values", "params": { "values": [42] } }

Yields 4 then 2 once then complete:

{ "use": "@finch/values", "params": { "values": "42" } }

Yields 42 three times then complete:

{ "use": "@finch/values", "params": { "values": [42], "times": 3 } }

Yields 42 indefinitely while waiting 100ms after each yield:

{
  "use": "@finch/values",
  "params": { "values": [42], "times": -1, "delay": 100 }
}

Same functionality, although this time authored using YAML:

use: "@finch/values"
params:
  values:
    - 42
  times: -1
  delay: 100

:bird:

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.2

5 years ago