Mixins and pure functions

Sometimes, you'll face situations where an existing component almost fits your new requirements​ but not quite. Some other times, you'll notice that different components actually have quite a lot in common, but also diverge too much in some respects.

Application design choices are often very situational, and there aren't many solutions that you can blindly apply, no matter what. For example, splitting components means introducing some level of duplication and breaking the DRY principle, while extending or combining existing components can lead to bloat (for example, too many properties on a single component) or introduce leaky abstractions and more trouble down the line.

Vue.js mixins (not to be confused with TypeScript ...

Get Learn TypeScript 3 by Building Web Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.