mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-02-05 11:34:22 +00:00
17 lines
546 B
JavaScript
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"))});
|
||
|
|
||
|
}
|
||
|
|
||
|
};
|