monx icon indicating copy to clipboard operation
monx copied to clipboard

V1 usage questions

Open kokujin opened this issue 7 years ago • 6 comments

  1. Is setting the state attributes the same as in the old version?
  2. 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

kokujin avatar Sep 15 '17 16:09 kokujin

I found these two things to be the same as the old version.

The only thing that changed was the initiation stage.

LeviSchuck avatar Sep 15 '17 18:09 LeviSchuck

Everything is the same except for initializing. It was just rewritten.

kbrsh avatar Sep 15 '17 22:09 kbrsh

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 avatar Sep 19 '17 01:09 janka102

@janka102 There is nothing wrong with it, but it should be fixed in v1.

kbrsh avatar Sep 19 '17 02:09 kbrsh

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 avatar Sep 27 '17 02:09 janka102

@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 😄

kbrsh avatar Sep 27 '17 03:09 kbrsh