npm install lazy-extendable
Download and reference via script
It's not a
Klass, and not even
If you want to create new extendable type you call
new LazyExtendable() or
.extend. Want to extend your type? Use
It doesn't add any own properties to prototype. Want add
super property to you type? Now you can.
Have a huge type hierarchy and it's all built every time, even when unneeded? Forget it, now certain types will be built only if you use them.
It's not necessary to change base types, just override method you need and call any base method you want.
var Woman =returnvar buffer = ;bufferpushthis_find;bufferpushthis_greet;bufferpushthis_throwPlate;return bufferjoin' ';return 'Here you are, jerk!';return 'Hello my darling.';return 'Take this!';;;var PoliteWoman = Womanextendreturnreturn base_greet;;;
Now you can name base instance as you want. Like Java? Call base methods via
super. Like C#? Call via
base. Like LOTR? Call it via
You can specify exact type of base type with annotations your IDE understand and get better autocompletion behavior.