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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.