We’ve just added class support to Tonic! JavaScript classes are shorthand that make it easier to work with JavaScript’s existing protoypal inheritance. As usual, Tonic is smart about the way it supports this feature, using Babel in earlier versions (like 0.12), but giving you full access to native classes in Node 4 and 5, even when not in strict mode. Give it a try:

class AbstractMockSingletonFactoryFactory { injectDependency() { console.log("Subclasser Responsibility"); } }

This brings Tonic’s ES6 support to near completion, making it one of the best places to try the latest JavaScript features in every version of Node!

Don’t forget, we’re holding office hours on Thursday if you want to stop by and discuss this or any other JavaScript features.

Blog Logo



Back to Overview