Hm, these points do not really ring for me. The thing that made hooks so neat is that you can compose them. I know you can do this here, too, but i have trouble understanding how this would go. In React there's a call order, which i don't see as a negative despite the memoization, imo it helps to establish linear intent. Also to me it seems thinking in lifecycles (mount/unmount) isn't ideal, too. With hooks you're dealing with what are essentially effects.
Here's an example, i wonder how something like this would look in Vue: twitter.com/dan_abramov/status/109... In that example you see how they're composed in a linear order, one feeding the other. Items go into a shuffle, then together with columns and width go into the grid, the grid goes into a transform. If these were all observables that just happen to be driven by some one-shot hooks, would you be able to glance over it like that and see the connection?
I'm honestly curious, overall i must say i like the direction Vue is now going.
I've tried to flesh out the Vue version here:
Make sure to read the README. I'm open to questions :)
Nice! You may want to change the third link in the README from a duplicate CodeSandbox link to dev.to/drcmda/comment/c7l9 🙂
Oh, thanks. Will do
Nice! That helps a lot to understand the differences.
No, there's no implementation available yet, the proposal is still being discussed and not adopted
There is an implementation github.com/liximomo/vue-function-api
Right, we came across this userland implementation as well in the meantime, it's pretty cool :)
Considering all that's going on right now I haven't had the time to try it, and can't say wether I will find time to use it for bringing this example to life in the coming days.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.