Press "Enter" to skip to content

Simplifying watchers with vuejs

Sharing is caring!

Above code is the normal code to watch the changes in property.

This portion  can simply be changed too:

No more messing inside both created methods and watcher.  Watcher alone is enough.

In general, the methods like updateNow methods are case specific, so to refactor again,

The property that needs to be watched are just handled by watchers alone now.

Everything is awesome.

Be First to Comment

    Leave a Reply

    Your email address will not be published.