Created
September 21, 2016 16:15
-
-
Save jackcallister/825535bcda5c0e0da4d4e894e6465b87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { observable } from 'mobx' | |
class UIStore { | |
@observable isSliderOpen = false; | |
@observable isAccountDropdownOpen = false; | |
constructor(state) { | |
Object.assign(this, state) | |
} | |
} | |
export default UIStore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { extendObservable } from 'mobx' | |
class UIStore { | |
constructor(state = {}) { | |
extendObservable(this, { | |
isSliderOpen: state.isSliderOpen || false, | |
isAccountDropdownOpen: state.isAccountDropdownOpen || false, | |
}) | |
} | |
} | |
export default UIStore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment