rocicorp / replicache-react

Miscellaneous utilities for using Replicache with React
MIT License
23 stars 8 forks source link

feat: Support more strongly-typed ReadTransaction. #55

Closed aboodman closed 1 year ago

aboodman commented 1 year ago

Problem

useSubscribe() is used by both Replicache and Reflect. Reflect has added a new form of ReadTransaction that has a generic get method. We would like users of replicache-react to be able to use that.

However, currently replicache-react pulls in Replicache directly and uses its ReadTransaction. We could publish a new Replicache with the new signature, but then we would have a new problem: that head replicache-react only works with the latest Replicache/Reflect.

Solution

Decouple replicache-react and Replicache completely by defining an abstract Subscribable.