-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
v3possible v3.0.0 featurespossible v3.0.0 features
Description
I am using the Online and Offline components in a couple of places within my application and noticed that the application is hitting the polling url every 5 seconds about 3 times, which shows that each Online/Offline component checks separately for the connection's status.
I propose creating a Provider which could be used to wrap the application's root component and just use a Consumer anywhere where the connection status is needed.
It would look something like:
<Provider {...config}>
<App />
</Provider>
<Consumer>
{({ online }) => (
<div>
{`${online}`}
</div>
)}
</Consumer>
I can create a PR to implement it if it's OK.
What do you think ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
v3possible v3.0.0 featurespossible v3.0.0 features