Open davestewart opened 5 years ago
OK, PoC working for root and modules here:
Tasks:
would be great to have this released, as I was going in circles in google trying to keep my code simple yet my state nested. Seems like with Vuex you cannot have both. Pathify to the rescue!
Hey @bkarlson - it's not a priority for me now (I have other things I want to spend my ODD dev time on) so don't hold your breath!
Yeah, I also ended up here thinking that this would've been a really cool addition to the library. Shame you're no longer into Vuex anymore if I read it correctly. Classes are indeed easier for OO devs but I'm more of a functional programming type of person. Anyway, thanks again for this amazing library. It already saved me a lot of time and effort in writing pointless setters
.
Maybe I'll just use your previous suggestion in another post:
import store from '../index'
const actions = {
foo({commit}, value) {
store.set('page@status', value)
}
}
This post is asking whether you can do Pathify style commits in actions, and the answer is currently no:
However, a quick monkey patch proves it might be possible to intercept the native commits and do something with them:
So with that in mind, it might be possible to detect
@
characters and do a Pathify styleset()
instead.Another option would be wrapping this in the existing commit helper, or even adding a helper to build and pass Payloads, like this demo