react-native-firestack icon indicating copy to clipboard operation
react-native-firestack copied to clipboard

[v3] transaction implemented?

Open tegument opened this issue 9 years ago • 6 comments

I'm trying to update a post object in Firebase using a transaction, but i'm getting an error that transaction is not defined.

I looked in:

\react-native-firestack\lib\modules\database.js

but do not see any references to transactions, is this implemented?

Example code:

function toggleStar(postRef, uid) { postRef.transaction(function(post) { if (post) { if (post.stars && post.stars[uid]) { post.starCount--; post.stars[uid] = null; } else { post.starCount++; if (!post.stars) { post.stars = {}; } post.stars[uid] = true; } } return post; }); }

tegument avatar Oct 19 '16 23:10 tegument

Good catch. We do not yet have transactions implemented.

Wanna make a PR? I can walk you through how to do it, if so. Otherwise, I'll see if I have time this weekend.

auser avatar Oct 20 '16 07:10 auser

I took a look but I think this is a bit over my head, I'm not much of a java programmer. I definitely appreciate your help.

tegument avatar Oct 20 '16 14:10 tegument

Also looking for this feature :)

Ehesp avatar Nov 06 '16 11:11 Ehesp

Alright. I'll prioritize this. Shouldn't be too difficult to implement, I don't think.

auser avatar Nov 06 '16 17:11 auser

Also looking for this feature. Any update on this?

mark2685 avatar Nov 16 '16 02:11 mark2685

Also looking for this feature, fix yet?

jandacreate avatar Dec 30 '16 03:12 jandacreate