fromNodeCallback
Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
Arguments
func
(Function
): Function with a callback as the last parameter to convert to an Observable sequence.[context]
(Any
): The context for the func parameter to be executed. If not specified, defaults to undefined.[selector]
(Function
): A selector which takes the arguments from callback sans the error to produce a single item to yield on next.
Returns
(Function
): A function which when applied, returns an observable sequence with the callback arguments as an array if no selector given, else the object created by the selector function on success, or an error if the first parameter is not falsy.
Example
Last updated
Was this helpful?