pool icon indicating copy to clipboard operation
pool copied to clipboard

Add `limitN` functions to wrap callbacks

Open natebosch opened this issue 6 years ago • 3 comments

For example:

R Function(P1, P2) limit2<P1, P2>(R Function(P1, P2) callback) =>
  (p1, p2) => withResource(() => callback(p1, p2));

This would make it easier to use pools for use cases like https://github.com/dart-lang/graphs/issues/39, wrapping in 2 levels of closures in place is pretty ugly.

natebosch avatar Dec 27 '18 20:12 natebosch

thoughts @kevmoo @jakemac53

natebosch avatar Dec 27 '18 20:12 natebosch

This should be a language feature. Thinking of all of the flavors of bind we have in the Zone API...

kevmoo avatar Dec 28 '18 01:12 kevmoo

https://github.com/dart-lang/language/issues/157

natebosch avatar Dec 28 '18 20:12 natebosch