DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
    • can-construct-super
    • can-define-stream
    • can-fixture
    • can-fixture-socket
    • can-jquery
    • can-stache-converters
    • can-stream
      • Methods
        • toStream
        • toStreamFromCompute
        • toStreamFromEvent
        • toStreamFromProperty
    • can-vdom
    • can-view-import
    • can-zone
    • steal-stache
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Ecosystem
  • /
  • can-stream
  • /
  • toStreamFromProperty
  • / On this page
    • toStreamFromProperty

      function

      Creates a stream on a {Observable} object that gets updated whenever the property value on the observable changes.

      • source

      canStream.toStreamFromProperty( obs, propName )

      Creates a stream based on property value change on observable

      var map = {
          foo: "bar"
      };
      var stream = canStream.toStreamFromProperty(map, 'foo');
      
      stream.onValue(function(value){
        console.log(value); // -> foobar
      });
      
      map.foo = "foobar";
      

      Parameters

      1. An {Observable}:

        observable object

      2. property {String}:

        name

      Returns

      {Stream}:

      A Kefir stream.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.