Open
Description
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; }); }