-
Notifications
You must be signed in to change notification settings - Fork 57
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
Child_added supported in sync? -> Adding to Documentation #84
Comments
Thanks! Yes, the If you want to only receive new or deleted children you can choose the event you want to use ( function * syncAddedChildren () {
const channel = yield call(rsf.database.channel, 'items', 'child_added') // 👈 add a third argument here 😉
while (true) {
const data = yield take(channel)
yield put(actionCreator(data))
} catch (err) {
yield put(failureActionCreator(err))
} finally {
if (yield cancelled()) channel.close()
}
} It never occurred to me that there was a strong use case for this but if that's the case for you we can definitely add an API to make this a lot simpler. :) function * syncAddedChildren () {
yield fork(
rsf.database.sync,
'items',
{ successActionCreator: ..., failureActionCreator: ... },
'child_added' // 👈 we could add a third argument here 🙂
)
} Please let me know if that would be interesting to you! :) |
Great !!!
Thanks for the clearance. Kind Regards BTW: I'm using this in react native - firebase sync & saga is super easy due to your library! |
Thanks for the feedback, this is much appreciated. :D
That sounds reasonable, I'll keep this issue open and notify you when this is ready. :) |
@ReactNativeBlog I've just released v0.8.0 with this change! Let me know how it works for you! :D |
First of all: Great Work!
I'm currently wondering which data is transferred on a sync in case a child was added/remove/... in the realtime database?
Is the whole data/ref transferred or only the delta?
Many thanks for clarification.
The text was updated successfully, but these errors were encountered: