p-hatan/ mirror

pub repository

mirror.p-hatan.ir

stream_transform

0.0.18

A collection of utilities to transform and manipulate streams.

Download archive

Readme

Utility methods to create StreamTransfomer instances to manipulate Streams.

asyncMapBuffer

Like asyncMap but events are buffered in a List until previous events have been processed rather than being called for each element individually.

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.

combineLatest

Combine the most recent event from two streams through a callback and emit the result.

combineLatestAll

Combines the latest events emitted from multiple source streams and yields a list of the values.

debounce, debounceBuffer

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

concurrentAsyncMap

Like asyncMap but the convert callback can be called with subsequent values before it has finished for previous values.

followedBy

Appends the values of a stream after another stream finishes.

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.

whereType

Like Iterable.whereType for a stream.

Changelog

0.0.18

  • Internal cleanup. Passed "trigger" streams or futures now allow <void> generic type rather than an implicit dynamic>

0.0.17

  • Add concrete types to the onError callback in tap.

0.0.16+1

  • Remove usage of Set literal which is not available before Dart 2.2.0

0.0.16

  • Allow a combine callback to return a FutureOr<T> in scan. There are no behavior changes for synchronous callbacks. Potential breaking change In the unlikely situation where scan was used to produce a Stream<Future> inference may now fail and require explicit generic type arguments.
  • Add combineLatest.
  • Add combineLatestAll.

0.0.15

  • Add whereType.

0.0.14+1

  • Allow using non-dev Dart 2 SDK.

0.0.14

  • asyncWhere will now forward exceptions thrown by the callback through the result Stream.
  • Added concurrentAsyncMap.

0.0.13

  • mergeAll now accepts an Iterable<Stream> instead of only List<Stream>.

0.0.12

  • Add chainTransformers and map for use cases where StreamTransformer instances are stored as variables or passed to methods other than transform.

0.0.11

  • Renamed concat as followedBy to match the naming of Iterable.followedBy. concat is now deprecated.

0.0.10

  • Updates to support Dart 2.0 core library changes (wave 2.2). See issue 31847 for details.

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.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add stream_transform
pubspec.yaml
name: stream_transform
description: A collection of utilities to transform and manipulate streams.
author: Dart Team <misc@dartlang.org>
homepage: https://www.github.com/dart-lang/stream_transform
version: 0.0.18

environment:
  sdk: ">=2.2.0 <3.0.0"

dev_dependencies:
  pedantic: ^1.5.0
  test: ^1.0.0

Version history

VersionPublishedArchiveSHA-256
0.0.12017-05-02T21:18:12.730976ZDownload574973b1a61c9ccd5e7f1a021af3ed3c1508c80513da830edc33377c58d5e52d
0.0.22017-05-05T18:25:02.549723ZDownloadd56853ca1013ec34229cc3db4524d842013767e35f1dfa988d7f163e7c098d82
0.0.32017-05-06T01:17:59.200588ZDownloadf60711efe4ad54f8afca1ccef2377d5d26a691f3ad82587f2d0f17107b87c136
0.0.42017-05-07T05:08:23.736115ZDownloadcdf3c3f60572c66348108d601ccd3b2e7b52e7efc2f10a7300bbadbf29571d7e
0.0.52017-05-08T19:29:30.337971ZDownload1261b0e7ec7525faf894ac06bda390565f0c07dfcb789b42ff63978ca0b56ce8
0.0.62017-07-11T17:49:52.346766ZDownloade77719c678540bde6f7f6745abbf79c5f740380b54feb371f4e20f2bef178ea0
0.0.72017-07-12T21:37:21.881557ZDownload0391cd3116fa81bd4d1a70ed8cd759b154fee516c9b82d1b72b5be5f6e869c6b
0.0.82017-08-04T21:29:35.335027ZDownload56a2a2cfe3fcaa79dc80e5c0e53955d864d5dbbaf8672b6b3db15e0434a0c024
0.0.92017-08-07T17:50:45.071548ZDownloada5b9ed095a4c82420c9a99f0e91d036754b0e4d71a9bf168c937de54db127b67
0.0.102018-02-01T17:36:18.358790ZDownload7c196f513c7722cdb88d2d97daeab1059b17564047729c06ff1094047a5bcd04
0.0.112018-03-26T21:54:37.981388ZDownload9ee052a3a9046bb255244f6560664de78907b81d03ceda925632de481ce7a441
0.0.122018-06-01T22:54:20.690496ZDownload5439ecb76e650162a8ff5be25aae5981b5eccb437facade133d5daaac73aae9c
0.0.132018-06-08T19:40:12.169781ZDownload2285694dfcc6da252ed408088bc03ccfa510b3fc29e6c49624776f71700660ac
0.0.142018-06-13T23:18:37.103439ZDownload8b26d738f6d22bf7e624e6dee8315fc4e7b3a03e0b9d8a6c65f00fc291ad63ec
0.0.14+12018-07-18T22:32:17.283866ZDownloadf0f15c31335a1e8ab4985f87562a729dab2e6e26d09d74ce2beb971ff37f5bf0
0.0.152019-02-12T23:44:03.199387ZDownloade89b3f1ce122c9094c4989cba732c7196f550672925a3d25eb7b501659f943a2
0.0.162019-03-12T22:16:35.569606ZDownloada2afa57962a504bc99ded884e223e8e6a3d617011f2f95556ae2a7008f9cae77
0.0.16+12019-03-13T17:02:43.561690ZDownloaddac417bcb952ddb4e72ee6bbac84b58b89de38cc057b88fd3cb9e433da2d821e
0.0.172019-03-26T16:40:37.009736ZDownload2d2b417fe44d5801abdf06152f76abd2afa9b0887706c93acc14b5d073dea838
0.0.182019-04-29T16:21:13.938771ZDownload49b1ae26e6bfe121084194bc5685edcea894bf91ed8ea01b80a6e7120800e230
0.0.192019-05-03T18:25:14.940260ZDownload030527e0c0ca872fae40bb8cbc357a4b181cc8890e260f2d62f824c364e275a4
0.0.202019-11-05T21:24:00.648789ZDownloade3ed6b5a9cac7b13e9a3c72abc360875538a133452a95b4f897bf73e626d2bf3
1.0.02019-11-20T21:38:34.753041ZDownload7ee84c48c00b0cf3561bba6de3b06f67d0fdb39824fd1b9ebb773ce5de697c77
1.1.02019-12-03T23:09:21.926102ZDownloadfb066a7c89d75af88be7e0f5c1d893057298d8420154d61757d729a750cfc526
1.2.02020-02-26T19:08:01.293710ZDownload0727efc56e75321979e4e29c4b0dd26885b689fef7f35262ed9b4f5e4a52454a
2.0.0-nullsafety.02021-01-13T21:21:37.589884ZDownload6a3b7bde2d886ddb1f9f26cf3cb9eef6fe645c6a9ecf9a3f616060b45fbcc971
2.0.02021-02-08T20:39:42.781950ZDownloaded464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e
2.0.12022-10-05T22:12:13.399222ZDownloadf1d172e22a5432c042b5adfa9aff621372e4292231d9d73ad00f486ad01c2395
2.1.02022-11-03T20:39:57.865165ZDownload14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f
2.1.12024-12-17T09:48:24.198454ZDownloadad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
2.1.22026-08-28T20:42:55.240271ZDownloada00e5f18bffc764f923e7dec1038527f7fe7a1791361a7117f0358193f13d53a

Dependencies

No direct dependencies declared.