GithubHelp home page GithubHelp logo

global19-atlassian-net / stream_transform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dart-lang/stream_transform

0.0 2.0 0.0 267 KB

Dart utility methods to create StreamTransfomer instances to manipulate Streams

Home Page: https://pub.dev/packages/stream_transform

License: BSD 3-Clause "New" or "Revised" License

Dart 99.85% HTML 0.15%

stream_transform's Introduction

Build Status Pub package

Extension methods on Stream adding common transform operators.

Operators

asyncMapBuffer, asyncMapSample, concurrentAsyncMap

Alternatives to asyncMap. asyncMapBuffer prevents the callback from overlapping execution and collects events while it is executing. asyncMapSample prevents overlapping execution and discards events while it is executing. concurrentAsyncMap allows overlap and removes ordering guarantees for higher throughput.

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

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, combineLatestAll

Combine the most recent event from multiple streams through a callback or into a list.

debounce, debounceBuffer

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

followedBy

Appends the values of a stream after another stream finishes.

merge, mergeAll, concurrentAsyncExpand

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.

Getting a StreamTransformer instance

It may be useful to pass an instance of StreamTransformer so that it can be used with stream.transform calls rather than reference the specific operator in place. Any operator on Stream that returns a Stream can be modeled as a StreamTransformer using the fromBind constructor.

final debounce = StreamTransformer.fromBind(
    (s) => s.debounce(const Duration(milliseconds: 100)));

stream_transform's People

Contributors

athomas avatar brettapeters avatar creativecreatorormaybenot avatar jonahwilliams avatar jtmcdole avatar kevmoo avatar leafpetersen avatar maxlapides avatar michaelrfairhurst avatar natebosch avatar tastypi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.