Open ayamflow opened 10 years ago
attached/detached
will still be there :)$unwatch
change is because multiple callbacks can be registered to the same keypath, so you can accidentally remove callbacks registered in other parts of the application if you are not careful. If you want to $unwatch(keypath, callback)
then you need to save a reference anyway.insert()
in the transition API - it's trivial to bring it back, or provide it as the beforeEnter
hook.Update: I've added a beforeEnter
hook to the js transition API.
+1 to the separate beforeEnter
hook for transitions! Great work and looking forward to the release.
$unwatch(keypath, callback) then you need to save a reference anyway.
I've always been doing $unwatch('prop', this.method);
- was I improperly unwatching ?
it's trivial to bring it back, or provide it as the
beforeEnter
hook
Cool! Just one remark: hooks are usually used for vm-related stuff whereas transitions/effects are separated/abstracted from the vm (no this
, no access to $emit
...). I feel the beforeEnter hook is kind of coupling the transition API - thoughts ?
Oh by beforeEnter hook I mean a js transition hook, just like enter and leave
On Sun, Aug 31, 2014, 4:07 PM ayamflow notifications@github.com wrote:
$unwatch(keypath, callback) then you need to save a reference anyway.
I've always been doing $unwatch('prop', this.method); - was I improperly unwatching ?
it's trivial to bring it back, or provide it as the beforeEnter hook
Cool! Just one remark: hooks are usually used for vm-related stuff whereas transitions/effects are separated/abstracted from the vm (no this, no access to $emit...). I feel the beforeEnter hook is kind of coupling the transition API - thoughts ?
— Reply to this email directly or view it on GitHub https://github.com/vuejs/Discussion/issues/65#issuecomment-53999699.
Perfect!
Hi Evan, Very motivating (and exciting) to see the list of upcoming changes - it's good to see that Vue is growing !
Here are some comments (most of them are simple questions/feedback though). Most of the breaking changes really make sense, which will make the transition rather easy !
hook changes
No more
attached
/detached
hooks, but it's cleaner/handier with the newready
hook. Perfect !Instance methods changes
I'm sad to see
$unwatch
go: for me it was a pain in the ass with Angular because of the need to keep a reference. With Vue, it means you have to put it intothis
to unbind it later, which seems like overkill to me (I avoid anonymous functions, and usually call$watch
inready
and$unwatch
in the$watch
listener, so my use-case is kind of a $once + $watch).Interpolation change
The one time interpolation is brilliant, I think most of the websites (not really web apps) built with Vue rarely need the 2-way binding. Good performance upgrade :)
Transition API
Super happy yo see the
done
callback in theenter
method ! It will make it easier to build plugins using the transition mechanisms (like I mentioned in #61). But sad to see theinsert
go, I used it a lot to set an initial state on the element (opacity, x/y...) to avoid any FOC.