//   Copyright 2014 François de Campredon
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.



var Rx = require('rx');


var PropsMixin = {
  getInitialState: function () {
    this.__propsSubject = new Rx.Subject();
    this.propsStream = 
      Rx.Observable
      .of(this.props)
      .merge(this.__propsSubject);
    
    return null;
  },
  
  componentWillReceiveProps: function (props) {
    this.__propsSubject.onNext(props);
  },
  
  componentWillUnmount: function () {
    this.__propsSubject.onCompleted();
  }
};


module.exports = PropsMixin;

@@ -639,16 +639,238 @@
 'rx');%0A%0A
+/**%0A * A Mixin that exposes props as RxJS Observables%0A * Component augmented with this mixin will have %0A * a 'propsStream' property, this observable will push%0A * a new value each time the component publish a new props %0A */
 %0Avar Pro
@@ -951,16 +951,24 @@
  Rx.
+Behavior
 Subject(
 );%0A 
@@ -963,23 +963,16 @@
 Subject(
-);%0A    
 this.pro
@@ -977,73 +977,34 @@
 rops
-Stream = %0A      Rx.Observable%0A      .of(this.props)%0A      .merge(
+);%0A    this.propsStream = 
 this
@@ -1018,16 +1018,30 @@
 sSubject
+.asObservable(
 );%0A    %0A

use behavior subject for propsStream