monx
monx copied to clipboard
V1 usage questions
- Is setting the state attributes the same as in the old version?
- Is the "dispatch" method also the same?
Is my store definition also V1 compatible?
const store = new Monx({
state: {
projects: [],
selectedProject: null
},
actions: {
// projects
updateProjects: function(state, payload) {
state.projects = payload; <-- does not seem to work anymore
},
selectProject: function(state, payload) {
state.selectedProject = payload;
}
}
});
Thanks
I found these two things to be the same as the old version.
The only thing that changed was the initiation stage.
Everything is the same except for initializing. It was just rewritten.
I am having the same issue, but it seems to come up using MoonRouter v0.1.3 (latest version as of this comment). Here is minimal reproduction on plnkr. And it gets error Uncaught TypeError: Cannot read property 'data' of undefined
(You can see in the dev tools on that page).
Is there anything wrong with having {{store.state.data}}
inside a component?
@janka102 There is nothing wrong with it, but it should be fixed in v1.
I might be missing something, but I don't see any reference to a v1 build besides in this issue. Is there an ETA and will it include Moon and MoonRouter too? Thanks.
@janka102 The current build in all official Moon repos are v1 (development) compatible. Moon v1 is essentially going to be a huge release that introduces some of breaking changes making it unique and stable.
All official Moon projects (Monx, and Moon Router) will be released with a v1 version as well. This issue is referring to the changes made in Monx v1.
Hopefully that clears things up. Be sure to let me know if you have any questions. The best place to ask would be in the Moon Slack. @LeviSchuck I'd love it if you joined as well 😄