Vue 3 | State Management With The Composition API ( Vuex Alternative? )

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

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

  • @JohnKomarnicki
    @JohnKomarnicki  3 года назад +9

    What do you think of this alternative method to creating a store (state management) with the composition API? Let me know in the comments

    • @mohammadaliafrasiaby2347
      @mohammadaliafrasiaby2347 3 года назад +1

      hello can you create "creating and use vue pagination" course for beginers?
      the courses in youtube is verry bad but your explaning is very good.

  • @cjmaaz
    @cjmaaz 3 года назад +4

    Great video!!!!
    Waiting for your next video at Traversy Media.

    • @JohnKomarnicki
      @JohnKomarnicki  3 года назад +1

      Thanks Maaz! Hopefully you should all see that soon!

  • @leonardthillmann9444
    @leonardthillmann9444 3 года назад +1

    That really helped me out. I didnt have to import the vuex library. Thank you.

  • @sanusivictorolajuwon514
    @sanusivictorolajuwon514 3 года назад +2

    You're a Life Saver. Thanks for always creating amazing contents 🙏🏽

    • @JohnKomarnicki
      @JohnKomarnicki  3 года назад +1

      Thanks for that. Glad they are able to help :)

  • @ajglj
    @ajglj 3 года назад +1

    Thank you John. Perfect video.

  • @sanghoonkim339
    @sanghoonkim339 2 года назад

    감사합니다. 많은 도움이 되었습니다!

  • @RodrigoDAgostino
    @RodrigoDAgostino 3 года назад

    Awesome tutorial! Thank you so much! :)

  • @badasscoder4481
    @badasscoder4481 3 года назад +2

    what about pinia

  • @johnnydriesen7575
    @johnnydriesen7575 3 года назад

    Thanks for your time to create this vid.
    Having two small questions:
    - how about Vuex Actions (so we can use async - await e.g. to retrieve data)
    - how about Vuex Namespaces ?
    Thanks in advance for taking your time to reply.

    • @JohnKomarnicki
      @JohnKomarnicki  3 года назад +1

      Glad you enjoyed it!
      1. You have the ablility to create those however you want. In the video I stuck to using the Vuex naming / format. So you can create a actions objects or do it inside of your methods. The option is up to you.
      2. For name spacing, all this is doing is breaking up your state. You can simple create multiple files like I’ve done here, and I’m pretty sure you’d have the same use as those to a certain degree. However, I think if your at a point of using this. You’re store might be a little to large to want to use this. That’s just my opinion, as I think this is perfect for smaller projects / stores.

    • @johnnydriesen7575
      @johnnydriesen7575 3 года назад

      @@JohnKomarnicki Thanks a lot for taking your time to reply.
      Highly appreciated !

    • @JohnKomarnicki
      @JohnKomarnicki  3 года назад

      @@johnnydriesen7575 no problem at all :)

  • @adolfusadams4615
    @adolfusadams4615 3 года назад

    Hi John, great tutorial! Could you do a tutorial showing how to use apollo (graphql) for state management in Vuejs?

  • @caiovinicius7871
    @caiovinicius7871 3 года назад

    This is really great when used on small projects, in big (really big) projects i'll go with Pinia.

    • @JohnKomarnicki
      @JohnKomarnicki  2 года назад +1

      Exectly. It’s a perfect solution for smaller projects when you only need a small
      simple store / state management

  • @oscaresteve5344
    @oscaresteve5344 3 года назад

    A good alternative and full typed !

  • @yeravl
    @yeravl 3 года назад

    Vuex or composition API? What's better?

    • @JohnKomarnicki
      @JohnKomarnicki  3 года назад

      Really depends on the project. Mainly the size of them. For smaller projects i think this method is a quick and efficient!

  • @sanderluis3652
    @sanderluis3652 2 года назад

    Pinia