stream_transform 0.0.9

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 98

Utility methods to create StreamTransfomer instances to manipulate Streams.

asyncMapBuffer

Like asyncMap but events are buffered until previous events have been processed.

asyncWhere

Like where but allows an asynchronous predicate.

audit

Audit waits for a period of time after receiving a value and then only emits the most recent value.

buffer

Collects values from a source stream until a trigger stream fires and the collected values are emitted.

concat

Appends the values of a stream after another stream finishes.

debounce, debounceBuffer

Prevents a source stream from emitting too frequently by dropping or collecting values that occur within a given duration.

merge, mergeAll

Interleaves events from multiple streams into a single stream.

scan

Scan is like fold, but instead of producing a single value it yields each intermediate accumulation.

startWith, startWithMany, startWithStream

Prepend a value, an iterable, or a stream to the beginning of another stream.

switchMap, switchLatest

Flatten a Stream of Streams into a Stream which forwards values from the most recent Stream

takeUntil

Let values through until a Future fires.

tap

Taps into a single-subscriber stream to react to values as they pass, without being a real subscriber.

throttle

Blocks events for a duration after an event is successfully emitted.

0.0.9

  • Add asyncMapBuffer.

0.0.8

  • Add takeUntil.

0.0.7

  • Bug Fix: Streams produced with scan and switchMap now correctly report isBroadcast.
  • Add startWith, startWithMany, and startWithStream.

0.0.6

  • Bug Fix: Some transformers did not correctly add data to all listeners on broadcast streams. Fixed for throttle, debounce, asyncWhere and audit.
  • Bug Fix: Only call the tap data callback once per event rather than once per listener.
  • Bug Fix: Allow canceling and re-listening to broadcast streams after a merge transform.
  • Bug Fix: Broadcast streams which are buffered using a single-subscription trigger can be canceled and re-listened.
  • Bug Fix: Buffer outputs one more value if there is a pending trigger before the trigger closes.
  • Bug Fix: Single-subscription streams concatted after broadcast streams are handled correctly.
  • Use sync StreamControllers for forwarding where possible.

0.0.5

  • Bug Fix: Allow compiling switchLatest with Dart2Js.
  • Add asyncWhere: Like where but allows an asynchronous predicate.

0.0.4

  • Add scan: fold which returns intermediate values
  • Add throttle: block events for a duration after emitting a value
  • Add audit: emits the last event received after a duration

0.0.3

  • Add tap: React to values as they pass without being a subscriber on a stream
  • Add switchMap and switchLatest: Flatten a Stream of Streams into a Stream which forwards values from the most recent Stream

0.0.2

  • Add concat: Appends streams in series
  • Add merge and mergeAll: Interleaves streams

0.0.1

  • Initial release with the following utilities:
    • buffer: Collects events in a List until a trigger stream fires.
    • debounce, debounceBuffer: Collect or drop events which occur closer in time than a given duration.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  stream_transform: "^0.0.9"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:stream_transform/stream_transform.dart';
        
Version Uploaded Documentation Archive
0.0.9 Aug 7, 2017 Go to the documentation of stream_transform 0.0.9 Download stream_transform 0.0.9 archive
0.0.8 Aug 4, 2017 Go to the documentation of stream_transform 0.0.8 Download stream_transform 0.0.8 archive
0.0.7 Jul 12, 2017 Go to the documentation of stream_transform 0.0.7 Download stream_transform 0.0.7 archive
0.0.6 Jul 11, 2017 Go to the documentation of stream_transform 0.0.6 Download stream_transform 0.0.6 archive
0.0.5 May 8, 2017 Go to the documentation of stream_transform 0.0.5 Download stream_transform 0.0.5 archive
0.0.4 May 7, 2017 Go to the documentation of stream_transform 0.0.4 Download stream_transform 0.0.4 archive
0.0.3 May 6, 2017 Go to the documentation of stream_transform 0.0.3 Download stream_transform 0.0.3 archive
0.0.2 May 5, 2017 Go to the documentation of stream_transform 0.0.2 Download stream_transform 0.0.2 archive
0.0.1 May 2, 2017 Go to the documentation of stream_transform 0.0.1 Download stream_transform 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Jan 21, 2018
  • Dart: 2.0.0-dev.15.0
  • pana: 0.10.0

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
96 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
98

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:stream_transform/stream_transform.dart.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use stream_transform.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <2.0.0
Dev dependencies
test ^0.12.20+13