Start process of better client-side file locations.
[openemr.git] / public / assets / literallycanvas-0-4-13 / js / reactGUI / createSetStateOnEventMixin.js
blobe4c603d80c978ebdffb774e11265a9523ff9f276
1 var React, createSetStateOnEventMixin;
3 React = require('./React-shim');
5 module.exports = createSetStateOnEventMixin = function(eventName) {
6   return {
7     componentDidMount: function() {
8       return this.unsubscribe = this.props.lc.on(eventName, (function(_this) {
9         return function() {
10           return _this.setState(_this.getState());
11         };
12       })(this));
13     },
14     componentWillUnmount: function() {
15       return this.unsubscribe();
16     }
17   };