twister-react/build-buffer/.module-cache/c0507185a13a0cc7a2425906aba3e513eaa09886.js
2015-04-30 11:22:58 +02:00

17 lines
546 B
JavaScript

module.exports = AppSettingsMixin = {
getInitialState: function() {
this.appSettings = JSON.parse(localStorage.getItem("twister-react-settings"));
},
componentDidMount: function() {
window.addEventListener("appsettingschanged", this.onappsettingschanged);
},
componentWillUnmount: function() {
window.removeEventListener("appsettingschanged", this.onappsettingschanged);
},
onappsettingschanged: function() {
this.setState({appSettings: JSON.parse(localStorage.getItem("twister-react-settings"))});
}
};