5 Elegant ways to use Pinia 🍍

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 16

  • @VueMastery
    @VueMastery  Год назад

    For more expert Pinia content, check out VueMastery.com 🍍👉 vuemastery.com/courses/

  • @akdasa
    @akdasa Год назад +18

    Why does STORE need to manage routes at all? In my opinion, the storage should not contain logic at all, except for data modifications.

    • @devegram
      @devegram 9 месяцев назад

      He is just using the Pinia Global State to provide the Router in the Global Scope, not for any kind of processing or etc.., sure he can do it another way, but this is just a simple direct approach.

  • @matthewpulls441
    @matthewpulls441 Год назад +1

    Thank you for making Pinia we ❤ it!

  • @davidvelasquez9356
    @davidvelasquez9356 Год назад +8

    It's funny seeing some comments criticise a CORE DEVELOPER WHO WROTE THE TOOLS he's discussing.

    • @fennecbesixdouze1794
      @fennecbesixdouze1794 Год назад +1

      Being a great library dev and being able to teach or explain something are not overlapping skills.
      Teaching and presenting concepts requires breaking something down logically in a way that flows from beginning to end. Whereas being a great library dev usually means seeing the entire system in all its complexity as a cohesive whole with no beginning and no end.
      Learning to write application code by reading code samples in documentation is a horrendous idea, because library devs are particularly interested in complex interactions and edge cases that you shouldn't be writing in your application code.

  • @ahmaddawood9691
    @ahmaddawood9691 9 месяцев назад

    Thank you ...great tutorial .... one of the main reasons i switched from react to vue is Pinia ...really great, scaleable and easy state management Library :) :)

  • @ColinRichardson
    @ColinRichardson Год назад +3

    setup functions are always 'the win'..
    I was wondering why we couldn't just use `export router = blarblar` before.. and I am glad to find out.. Oh, you CAN..
    I was told it didn't work like that.. but that was when vue3 was not official yet.. so I am glad we get back to the easy way again.

  • @dasten123
    @dasten123 Год назад

    15:46 that PR you were talking about, is it merged yet? Does this work now?

    • @posva13
      @posva13 7 месяцев назад +1

      yes, it works now

  • @Wojtasvx
    @Wojtasvx Год назад +5

    Something is wrong with that code. Store shoudn't know about router. For example if button trigger loggout there should be method that call some store with user logout and in the next line should be router.push. If u want to encapsulate this code u should use composable.

    • @dmitryryabtsev9153
      @dmitryryabtsev9153 Год назад +1

      Debatable.

    • @DarkzarichV2
      @DarkzarichV2 Год назад +1

      Absolutely right. Mixing those different concerns will bring troubles later

  • @lphiro5602
    @lphiro5602 10 месяцев назад

    code font read hard .

  • @ScubyDooBy69
    @ScubyDooBy69 Год назад +6

    somewhere SOLID is crying