export function
Closed this issue · 4 comments
jan-swiecki commented
module.co:
export (x)->
main.co:
fn = require './module.co'
console.log typeof fn
prints object
. How do I make this return function
type? (like module.exports = (x)->
)
jan-swiecki commented
How do I mark this as a question?
vendethiel commented
You have to actually name the export. export a
or export foo: bar
satyr commented
Since assigning to module.exports
is a Node.js specific feature and doesn't have the DRY problem, we don't offer a sugar for it. Simply do module.exports = -> ...
.
jan-swiecki commented
Got it! Thank you!