pipe

fnauto pipe(SourceArgs, TargetArgs)( ref Hap!SourceArgs source, ref Hap!TargetArgs target, void delegate(SourceArgs, ref Hap!TargetArgs) @safe transform) @safe

Pipe events from a source hap through a transform function to a target hap.

pipe registers a handler on the source hap that transforms each event and re-emits it on the target hap. The returned Registration can be used to disconnect the pipe.

Parameters

sourceThe upstream hap to listen to.
targetThe downstream hap to emit transformed values into.
transformA function that maps source args to target args.

Returns

A Registration for the pipe connection.