synchronize
synchronize copied to clipboard
Synchronize functions which are declared in the main module
You are giving an example for readFile
sync(fs,"readFile")
I tried to Synchronize functions which i am declaring in the main module.
sync("combo")//does nothing
sync(global,"combo")//global does not contain a function combo
sync(main,"combo")//main does not con....
how should i do that? thanks
You can use that case like this...
var _ = {};
_.combo = combo;
sync(_, 'combo');
// maybe you need reassign
// combo = _.combo;
But, many case, I use this method instead wrap method.
combo(sync.defer());
sync.await();
that second way is very good, because of the )))))'s at the end of a wrapped sync.await\defer