Open Sieniawsky opened 9 years ago
data being an object?
Data is just an example, but there could be more than one if needed such as:
foo = (data, data2, options, done) ->
# do something
I understand this convention, but I have no use for callbacks in most of the functions I have written thus far, maybe further on into the project a refactoring can be done to make the code more JS/CoffeeScript friendly
Currently, a lot of the code base uses excessive parenthesis. By design CoffeeScript does not require parenthesis when invoking a function, unless the function takes no arguments, or some post-fix operators are used. Additionally, function signatures should conform with following pattern:
Where
data
could be any number of parameters anddone
is the top-level callback.For example the code here can be simplified:
This:
Becomes this with the
(data, done)
pattern and reduced parenthesis: