parallel-js / parallel.js

Easy multi-core processing utilities for Node.
MIT License
3.23k stars 200 forks source link

Is it possible to use such function: (data: N) => T as the parameter of the map method? #229

Open zhengger opened 3 years ago

zhengger commented 3 years ago

I'm using Typescript. The current map only accepts functions like : fn: (data: N) => N. But in practice, I need to feed the map with function like : (data: N) => T. T is not the same type as N. Could you tell me how to do it? Thank you so much!

public map<N>(fn: (data: N) => N): Parallel<T>