Pigeon
A Little Helper Spring To Call/Access Methods Between React Components
Motivation
The communication is always boring between components, yes there are amazing libraries such as Redux, Mobx even EventBus.
Sometimes you need call a method from a component to another, or sometimes you need to setState from a component to another for a little job.
You have spent your time to setup big amazing libraries 'cause they have actions, reducers, sagas and more.
Please do not confuse, this is not drill down or callback ?
The main goal is solving your little problem with Pigeon.
How it works?
Install
- Npm:
npm install react-pigeon
Rules
- pigeOn function takes two arguments, first one is required (string);
-
Pigeon throws an error if you did not release it when you call pigeOn
-
If you release pigeon many times, you will see a warning in console like;
The Component is already in cage.
Example Scene
You can see it in action with this demo