szaranger / firebase-saga

A library for connecting redux-saga middleware to Firebase.
58 stars 15 forks source link

Using the create function #2

Closed luandro closed 8 years ago

luandro commented 8 years ago

Thanks for this, a real life saver.

I'd like use Firebases push method, I took a look at your create method but couldn't make much sense on how to use it. Could you give an example?

Cheers!

szaranger commented 8 years ago

Hi @luandro,

Thanks for the feedback. I'm working on couple of helper methods at the moment and I'll have the push method ready and tested within two days.

cheers, Sean

luandro commented 8 years ago

I'll keep an eye!

szaranger commented 8 years ago

Hi @luandro,

I've implemented push in firebase-saga version 1.0.17.

Here is an example usage:

import { push } from 'firebase-saga';

yield call(push, 'posts', () => ({
        title: 'Fourth Post',
        body: 'This is a the fourth post',
        timestamp: +new Date
    })
);

You can look at a full working example here: https://github.com/szaranger/firebase-saga/tree/master/examples/blog

luandro commented 8 years ago

Hey @szaranger, thanks!

I implemented it yesterday as well, very similar to what you did. Did you getting error handling to work?

szaranger commented 8 years ago

Hey @luandro,

Error handling is something I have in the pipeline.