Code Monkey home page Code Monkey logo

Comments (3)

dfahlander avatar dfahlander commented on June 10, 2024 1

There's no a need to use for await since Dexie API's don't return async iterables. You can await things in normal for...of loops though!

await db.transaction('rw', db.test, async () => {
  const test = await db.test.bulkGet(keys); // test will be a normal array.

  for (const t of test) { // no need to for await of normal array
    // do some things...

    await db.test.put(t)

    // do something else...
  }
}

from dexie.js.

secondl1ght avatar secondl1ght commented on June 10, 2024

I see now in the docs that this example is similar to what I am trying to acheive except it uses Promise.all: https://dexie.org/docs/Dexie/Dexie.transaction()#the-auto-commit-behavior-of-indexeddb-transactions. So I think I am OK to use the above code example in my post or use the Promise.all method from the docs because that way the Transaction will complete sooner I think.

from dexie.js.

secondl1ght avatar secondl1ght commented on June 10, 2024

I think I answered my own question, please let me know if anything I assumed is incorrect. :)

from dexie.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.