create<T> function

Observable<T> create<T>(
  1. Callback1<Subscriber<T>> callback

Creates an Observable that uses the provided callback to emit elements to the provided Subscriber on each subscribe.

On each subscription the callback is run and a Disposable is returned. The callback can synchronously or asynchronously generate events on the passed-in subscriber, as well as register dispose actions by using Subscriber.add.

For example:

final observable = create


Observable<T> create<T>(Callback1<Subscriber<T>> callback) =>