New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rx.observable.combine-template

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx.observable.combine-template

RxJS alternative to Bacon's combineTemplate

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Rx.Observable.combineTemplate

Generate values based on the Observable and object template. Similar to Bacon.combineTemplate.

Usage

Install

npm install --save rx.observable.combine-template

Basics

import combineTemplate from 'rx.observable.combine-template';
import * as Rx from 'rx';

let subject1 = new Rx.Subject();
let subject2 = new Rx.Subject();

combineTemplate({
  foo : 'bar',
  baz : {
    foo : ['bar', subject1 'qux']
  },
  qux : {
    foo : {
     foo : 'bar'
     baz : subject2
    }
  }
}).subscribe((value)=> {
  console.log(value);
  /* === output ===
  {
    foo : 'bar',
    baz : {
      foo : ['bar', 'BAZ' 'qux']
    },
    qux : {
      foo : {
       foo : 'bar'
       baz : 'QUX'
      }
    }
  }
  */
});

subject1.onNext('BAZ');
subject2.onNext('QUX');

with React

State is updated automatically receives a value from the observables.

componentWillMount() {
  combineTemplate({
    items : store.itemsObservable$,
    count : store.itemsObservable$.map((items) => items.length)
  }).subscribe(this.setState.bind(this));
}

Tests

npm test

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT

FAQs

Package last updated on 08 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc