We renamed the old tweetIsEmpty property to tweetIsOutOfRange and updated the function’s logic accordingly. Note how we are using the computed charactersRemaining property to derive this value. Hooray for code reuse!
A Vue.js introduction for people who know just enough jQuery to get by
Matt Rothenberg
3K32

Your post is fantastic, congrats! However, I think a better code reusal would be to leave “tweetIsEmpty” untouched and involving it into the new “tweetIsOutOfRange” feature. So extending the functionality instead of renaming it. This way tweetIsOutOfRange would be built upon already existing knowledge:

tweetIsOutOfRange: function() {
 return this.tweetIsEmpty || this.charactersRemaining < 0;
 }

However this is fully subjective :) Personally, for me it was not so logical to get rid of the function we already built in step2. So this is just a very subjective feedback.

Keep up the good work! :)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.