ericholiveira / studio

A nodejs framework to create decoupled and scalable applications
MIT License
488 stars 61 forks source link

ES6 Class #51

Closed sean-hill closed 8 years ago

sean-hill commented 8 years ago

Hey @ericholiveira,

The example for ES6 classes, copied and pasted, throws this error:

barService();
^

TypeError: barService is not a function
    at Object.<anonymous> (/Users/Comfy-Blitz/Desktop/studio/index.js:21:1)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3
ericholiveira commented 8 years ago

Sorry... just change the final lines var fooModule = Studio.module('Foo'); instead of var fooModule = Studio('Foo');

var fooModule = Studio.module('Foo'); //this is the wrong line
var barService = fooModule('bar');
barService();

If you want to print something to the console, just change barService() for barService().then((res)=> console.log(res))

I also fixed the readme.md example... thx :)