import Space, { subscribe } from 'spaceace'; | |
const space = new Space({ | |
appName: "SpaceAce demoe", | |
user: { name: 'Jon', level: 9001 } | |
}); | |
subscribe(space, ({ newSpace, causedBy }) => { | |
console.log(`State updated by ${causedBy}`); | |
ReactDOM.render( | |
<h1>{newSpace.appName}</h1>, | |
document.getElementById('app') | |
); | |
}); | |
// Causes React to render | |
space({ appName: "SpaceAce demo" }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment