react-connect-context icon indicating copy to clipboard operation
react-connect-context copied to clipboard

Component connect multiple consumers

Open idarbuashvili opened this issue 6 years ago • 5 comments

Hi, I believe this library can be further improved by adding possibility to consume multiple consumers at once. I can provide code for that, but not in TS in JS. Thanks

idarbuashvili avatar Dec 18 '18 12:12 idarbuashvili

Sure! If you'd like to start with providing JS, we can turn it into TS and collaborate if you're up for it. 💞

TejasQ avatar Dec 19 '18 10:12 TejasQ

Yes, sure. https://gist.github.com/idarbuashvili/a57ca6b1ea86d4828f99ea21c14d246e, I believe the gist code above does exactly, what is now on the repo, but additionally I added recursive approach to handle multiple consumers passed in as rest params.

idarbuashvili avatar Dec 19 '18 10:12 idarbuashvili

Wanna turn that into a PR? 😄

TejasQ avatar Dec 19 '18 10:12 TejasQ

Sure, will do later today or tomorrow :grin:

idarbuashvili avatar Dec 19 '18 10:12 idarbuashvili

Maybe as well turn into TS

idarbuashvili avatar Dec 19 '18 10:12 idarbuashvili