Is this valid transaction code? #1563
-
Hello, I recently started working with Dexie and I am wondering if I can use Promise.all to add/update multiple entities. Is this a valid code for a transaction? db.transaction('rw', db.users, db.notes, async () => {
const [user_id, note_id] = await Dexie.Promise.all([
db.users.update(userId, { name: fullName, email: email, 'meta.tutorial_seen': 1 }),
db.notes.add({ something: 'something'})
]);
return [customer_id, thread_id, chat_id];
}); |
Beta Was this translation helpful? Give feedback.
Answered by
dfahlander
May 6, 2022
Replies: 1 comment
-
Yes you can use Promise.all() like that within a transaction. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
shwarcu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes you can use Promise.all() like that within a transaction.