feathers-plus / feathers-offline-realtime

Offline-first realtime replication, with optimistic updates while connected.
MIT License
33 stars 9 forks source link

Feature Request: Deeper Integration with feathers-redux #18

Closed subodhpareek18 closed 4 years ago

subodhpareek18 commented 6 years ago

Currently feathers-offline-realtime when taking the first snapshot does not update the isLoading prop in the relevant store created by feathers-redux

subodhpareek18 commented 6 years ago

One more thing we could do and it's probably a breaking change is to pass the reduxified service and not the service directly, and in which case it'll also automatically add a subscriber. Or maybe have an option to do both in order to keep backward compat.

const conversationsRealtime = new Realtime(client.service('conversations'), {
    subscriber: (records, last) => {
      reduxifiedServices.conversations.store({
        connected: conversationsRealtime.connected,
        last,
        records
      });
    }
  });
const conversationsRealtime = new Realtime(reduxifiedServices.conversations, {
    feathersRedux: true // indicating the deeper integration to switch on
  });