Extend using a decorator!
Example
Given two classes Hi and Boo, extend Hello.
// part 1a { return 'hi' }
// part 1b { return 'boo' }
// part 2 @ { $helloinnerHTML = this } { return 'hello' } @ { $helloOverwriteinnerHTML = ` and ` } { return 'hello' }
If the last argument for @extend()
is a boolean true, overwrite matching methods. To extend with more objects, just pass them as additional arguments i.e. @extend(A, B, C)
.