Time to mature the API a bit.
Instead of return an isComplete flag for queries, I think it'd be better to return a status flag that matches the subscription API.
So, queries can have the following statuses:
complete: the request has been completed using data from the redux store
loading: the request is still awaiting data from the server
subscriptions:
subscribing: cashay.subscribe has been called, but the subscriber has not yet executed
ready: the subscriber has been executed & is waiting for docs to come in
unsubscribed: the subscription has been closed
[USER_DEFINED]: allow the user to set whatever status they like via a handlers.setStatus call from their subscriber. This is useful for things like:
initializing: sending the initial batch of documents
initialized: all the initial documents have been received
Time to mature the API a bit. Instead of return an
isComplete
flag for queries, I think it'd be better to return astatus
flag that matches the subscription API.So, queries can have the following statuses:
complete
: the request has been completed using data from the redux storeloading
: the request is still awaiting data from the serversubscriptions:
subscribing
:cashay.subscribe
has been called, but thesubscriber
has not yet executedready
: thesubscriber
has been executed & is waiting for docs to come inunsubscribed
: thesubscription
has been closed[USER_DEFINED]
: allow the user to set whatever status they like via ahandlers.setStatus
call from theirsubscriber
. This is useful for things like:initializing
: sending the initial batch of documentsinitialized
: all the initial documents have been receivedready
: see above