Git Product home page Git Product logo

dart-rx's Introduction

Reactive Dart

Pub Package Build Status Code Coverage GitHub Issues GitHub Forks GitHub Stars GitHub License

Reactive Extensions Library for Dart providing an API for asynchronous programming with observable streams.

Reactive is created in the style of ReactiveX, and does not depend on Dart Streams. Though there are converters to and from Stream and Future instances. At this point this code is quite experimental, and might miss features or have serious bugs.

This library is open source and well tested. Development happens on GitHub. Feel free to report issues or create a pull-request there. General questions are best asked on StackOverflow.

The package is hosted on dart packages. Up-to-date class documentation is created with every release.

License

The MIT License, see LICENSE.

dart-rx's People

Contributors

lukepighetti avatar renggli avatar tsouza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dart-rx's Issues

remove references to RxDart in readme

There is already a popular package called RxDart, so referencing this in your readme makes it look like this is a fork. I would recommend removing all references to RxDart to avoid confusing people who find your package.

Why should I use this library instead of RxDart?

RxDart already exists which not only provides the ReactiveX behavior and interfaces in Dart, but does so by extending native Dart streams instead of trying to replace them altogether. (It's also been around a while and has matured and been battle-tested in that time.)

This library's observables not being based on Dart streams seems to be a massive reason to not use this library, and it seems like the only interoperability is a light observable type that wraps the Stream object without exposing it or any of its functionality. and aside from that, there doesn't seem to be any way for a Dart stream to listen to a Dart-Rx observable, which makes working with native stream functions or other third-party library streams incredibly difficult.

So to get to the point, what does this library offer that A) RxDart doesn't already provide, and B) outweighs the loss of nearly all native Stream interoperability?

nit: remove $ from examples

Idiomatic dart doesn't use $ for streams since we have had a strongly typed language from the beginning. While use of $ is common in JavaScript it is very uncommon in Dart. Just a minor nit. I only bring it up because people without rxjs experience will be confused by this use of $

change lib/core.dart to lib/rx.dart

Hi there, really interested in what you're doing here. Just a heads up, consumers of this package will expect to be able to use it with import 'package:rx/rx.dart'. The entrypoint for this package is not clear otherwise.

How to integrate library with API call like Retrofit on Java/kotlin

  • First of all, thanks for your nice repo.
  • In my case, i need to call the restful app then return the Observable<Result> when complete via emiter like Rxjava into onNext, onError or complete
  • The Issuse I meet is I can't make the API call with network without await / async keywork. If the functioin has await keyword, it require async keyword then Future required. But exactly type we need in return is Observable<Result>
    Bellow is my code. I need function getUserObservable return <Observable<UserResponse>> instead Future

"finalize" not being called

In rxjs we can do this:

const test = new ReplaySubject<string>(1);
test.pipe(
	finalize(() => console.log('finalize'))
).subscribe({ next: (n) => console.log(n) });
test.next('test');
test.complete();

Will print:

test
finalize

But using rx:

  var test = ReplaySubject<String>(bufferSize: 1);
  test.finalize(() {
    print('finalized');
  }).subscribe(Observer.next(print));
  test.next('test');
  test.complete();

Will only print:

test

It seems that the new Disposable returned from the subscribe is not being disposed with test.complete() is called.

Contribution

Greetings, I've been looking at this reactive programming package and really liked the idea of bringing a similar implementation of RxJS / RxJava, I was wondering how I can contribute to this, documentation, adding new operators or something that can help grow this library.

"share" operator

I think the answer is no, but I would I like to confirm. Is there any combination of available operators that would result in the same behaviour as the share operator?

If not, I'll send a PR

New release

Do you plan to release a new version soon with the recent fixes and new features?

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.