Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using micro-observables library without react #7

Open
pkieltyka opened this issue Jun 3, 2020 · 1 comment
Open

using micro-observables library without react #7

pkieltyka opened this issue Jun 3, 2020 · 1 comment

Comments

@pkieltyka
Copy link

I'm becoming quite fond of micro-observables and I'd like to use it in a library I'm writing that is not React based. I see 'react' is a peerDependency which will work fine but of course npm/yarn will complain of an unmet peerDependency.

The only react requirement if the hooks within https://github.com/BeTomorrow/micro-observables/blob/master/src/hooks.ts#L1, a thought would be to package this as a separate library just for the hook? or I believe making 'react' an optionalDependency might work as well.

@simontreny
Copy link
Collaborator

Hi Peter,

Thanks for your feedback. You're right, micro-observables is not tightly coupled to React and it is probably a good idea to split it into two packages. The optionalDependency option is unfortunately not a good solution for this, as it only specifies that if the dependency fails to install, npm install will still succeed. It means that running npm install micro-observables will actually install react in your project.

I'll probably split the library into two packages in the near future, I'll update this issue when this is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants