IndexedDB Part 3 - get and getAll

Поділитися
Вставка
  • Опубліковано 16 лис 2024

КОМЕНТАРІ • 11

  • @rafaelfgyn28
    @rafaelfgyn28 3 роки тому +1

    Fantastic video. It was exactly what I needed. Nice Job!!!

  • @talltonchalacolacerdasanto7466
    @talltonchalacolacerdasanto7466 2 роки тому +1

    Thanks! Great explanation.

  • @jimlanpheer5281
    @jimlanpheer5281 3 роки тому +3

    This is REALLY instructive and i'm trying to use it as a model for some code that i am writing, but i'm coming up short in applying it. Can anyone address whether at the 11:56 mark that "whiskey" value is a reference to something or is it a name pulled out of thin air? Could the value of the variable have been 'bob' (for example) at line 89? I'm working thru an example (using my own objects and data of course) and when i reference the variable name in my 'return `` statements, i keep getting 'Undefined'. In the example, the author has declared a type above on line 46 called 'whiskey' and i'm wondering if that object is related to the map or if those variables just have coincindentally been named the same thing.

    • @jimlanpheer5281
      @jimlanpheer5281 3 роки тому

      I can't seem to get my values out of the request.result return object, i can't figure it out.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 роки тому

      Inside the Array map( ) method on line 89, `whiskey` represents the next item from the array request.result.
      So, on line 90 we are referring to that object.
      Line 88 writes out the object to the console. You should be able to see the structure of the object and the result array, if there was any data in your database. If the structure of your data is different then the result in the console will be different. You will have to adjust your map( ) function accordingly.
      The line 46 `whiskey` variable is scoped inside the submit function. It is a template for a new object being added to the data store.

  • @jantomegoy1612
    @jantomegoy1612 3 роки тому +1

    thanks professor

  • @prajwolkoirala7
    @prajwolkoirala7 3 роки тому +1

    Dude you fucking saved my ass, the docs were not helpful with fetching

  • @arlozorov72
    @arlozorov72 2 роки тому

    line 103 li.getAttribute('data-key') returns null for me.
    instead I used: let id = li.dataset.key

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 роки тому +1

      The two commands are equivalent and both supported everywhere so there must be something else going on leading to the issue.

    • @aprendiendopasoapaso_isc1023
      @aprendiendopasoapaso_isc1023 Рік тому

      I have the same problem and I don't know how to solve it.
      Could you share your code, just that section?

    • @aprendiendopasoapaso_isc1023
      @aprendiendopasoapaso_isc1023 Рік тому

      @@SteveGriffith-Prof3ssorSt3v3 It will be that you can help me I don't know where the problem comes from