Skip to content

dough-com/ember-dxfeed

Repository files navigation

ember-dxfeed

Thin wrapper around dxfeed for use in Ember.

Usage

Command-line:

$ ember install git://github.com/dough-com/ember-dxfeed
$ export DXFEED_URL='http://path.to/qds/cometd'

Code:

const RawApi = Ember.Object.extend({
  dxfeed: Ember.inject.service(),

  init () {
    this.get('dxfeed')
      .subscribeTo('trade', 'AAPL')
      .on('trade', (dxEvent) => {
        console.log(dxEvent.price);
      });
  }
});

const QuoteApi = Ember.Object.extend({
  dxfeedQuote: Ember.inject.service(),

  init () {
    this.set('quote', this.get('dxfeed').subscribe('SPY'));
  },

  quotePriceObserver: Ember.observer('quote.price', function () {
    console.log(this.get('quote.price'));
  })
})

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published