totemstech / fwk

simple fwk for node.js
MIT License
11 stars 13 forks source link

Please review: [add factory / replace mplex by async] #10

Closed n1t0 closed 11 years ago

spolu commented 11 years ago

change discussed to be added

pierrevalade commented 11 years ago

like.

spolu commented 11 years ago

@pierrevalade :)

n1t0 commented 11 years ago

Updated

spolu commented 11 years ago

Can you give me an example of how you plan to use expose ?

n1t0 commented 11 years ago

exports.factory = fwk.factory.expose(factory); Where factory is the one which inherits from fwk.factory.get Le 29 nov. 2012 17:23, "Stanislas Polu" notifications@github.com a écrit :

Can you give me an example of how you plan to use expose ?

— Reply to this email directly or view it on GitHubhttps://github.com/teleportd/fwk/pull/10#issuecomment-10854760.

spolu commented 11 years ago

how would this be different from:

exports.factory = myfactory({});

I was more looking for something that would install a get method that returns a singleton of the factory

// in myfactory.js

var myfactory = function(spec, my) {
  //...
  var that = fwk.factory(spec, my);
  //...
  return that;
}

fwk.factory_expose(exports);

Then

// anywhere

var factory = require('myfactory.).get();   // singleton
n1t0 commented 11 years ago

Changes made as discussed

spolu commented 11 years ago

OK