Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.49k stars 589 forks source link

React Hooks #270

Closed brunolemos closed 5 years ago

brunolemos commented 5 years ago

Full api using only React Hooks.

I see there's an open PR for one hook but I didn't find an issue specific for this.

kilbot commented 5 years ago

Hi @brunolemos, I'm working on a basic useDatabase hook (ie: useContext(DatabaseContext) in https://github.com/Nozbe/WatermelonDB/pull/269. I'm also working on TypeScript typing:

usedatabase-ts

What other hooks did you have in mind?

My knowledge of hooks, observables and typescript is very basic, I could use some tips if you have some 😄

radex commented 5 years ago

useDatabase is merged, useObservables is an open issue in the related repo. I don't see other use cases currently, but if there's there — feel free to sen PRs