Select to view content in your preferred language

Sharing Data Between Components

138
0
3 weeks ago
Glyphmo
New Contributor

Hello!

I'd like to have multiple instances of a class (A) communicating directly to the SAME instance of another class (B) in my Widget, perhaps in a singleton manner.

I'd ultimately like to have one loop running in that singleton class (B), which could be started and stopped by any instance of (A). I was able to link both classes, but each instance of (A) creates IT'S OWN instance of (B), which is the opposite of what I'd like.

Is there any way to handle this in React?

 

Thank you for any input in advance!

0 Kudos
0 Replies