Code Monkey home page Code Monkey logo

ember-stream's Introduction

Ember Stream NPM Version

Observable streams addon for Ember CLI projects, using ReactiveX (RxJS).

Use in Ember CLI

ember install ember-stream

Stream Service

The primary object available is the stream service, located at /addon/services/stream.js. You should inject this service into your Ember objects:

    streamService: Ember.inject.service( 'stream' ),

This service has the following methods available:

Rx

This is an alias to the main Rx library, so that any object using the streamService has direct access to the native Reactive functionality.

createStream( func )

Create an observable stream from a function definition. This currently just wraps Rx.Observable.create(), but in the future will support additional Ember-friendly patterns.

findStream( streamName )

Lookup and return a named stream registered on the streamService.

registerStream( streamsObjectOrName, stream )

Register an observable stream to a referenceable name. Any observers that are awaiting subscription to this stream will be subscribed at this point.

There are two ways to call this method:

  • Pass in a single name and stream instance
  • Pass in a key-value hash, where each key is the stream name and its value is the stream instance
subscribeTo( streamName, observerOrOnNext, onError, onCompleted )

Attempt to subscribe an observer or series of callbacks to an observable stream. If no observer is registered under the streamName, then the subscription will not be setup until the stream is registered.

There are two ways to call this method:

  • Pass in the streamName and at least one callback function
  • Pass in the streamName and an Rx.Observer object
unregisterStream( streamName )

Removes the named reference to the stream registered to streamName.

Installation

  • git clone this repository
  • npm install
  • bower install

For more information on using ember-cli, visit http://www.ember-cli.com/.

ember-stream's People

Watchers

James Cloos avatar Jason Mitchell 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.