for example

child.stdout.on \data (buffer) -> 
   result.stdout += buffer

-->

child.stdout.on('data', function(buffer){
  return result.stdout += buffer;
});

and I need it without return. In F# I can add |> ignore how can I handle it in livescript?

有帮助吗?

解决方案

You can prepend an ! to the definition of the function:

!(buffer) -> result.stdout += buffer

Alternatively, return void

child.stdout.on \data (buffer) -> 
   result.stdout += buffer
   void

In JavaScript, when you return undefined (void), it is the same as not returning anything.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top