Last active
December 1, 2016 16:21
-
-
Save MarcoWorms/49b330321e13f77d8a66f76866e71c9c to your computer and use it in GitHub Desktop.
This file contains 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
function renderState (state) { | |
var html = '<p>' + state.something + '</p>' | |
document.getElementById('root').innerHTML = html | |
} | |
function createStore() { | |
var state = { | |
something: "olá mundo" | |
} | |
renderState(state) | |
return { | |
getState: function () { | |
return state | |
}, | |
setState: function (newState) { | |
state = newState | |
renderState(state) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment