-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Check if we can remove the export of 'analytics' object #3
Comments
If we use a Provider style, like redux, we should be able to avoid this. import {createRootDispatcher} from 'shisell';
import {AnalyticsProvider} from 'react-shisell';
const writer = event => console.log('Analytic sent', event);
const dispatcher = createRootDispatcher(writer);
const Root = () => (
<AnalyticsProvider dispatcher={dispatcher}>
<MyApp />
</AnalyticsProvider>
);
ReactDOM.render(<Root />, ...); This shouldn't be a big change, we can include it as a part of 1.0.0 |
So I've given this some more thought, it's not as simple as I thought it was.
I'm gonna go with option number 2 for now and see if I run into anything major, because it seems like the best balance of hackiness to good APIs. |
currently the analytics object is exposed because it was being used in our app. We need to see if we can stop exposing it, or maybe it needs to be created in the app and injected to the library.
The text was updated successfully, but these errors were encountered: