You can now put all of your NgRx State where?!

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

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

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

    This is actually very cook. Coming from watching Ryan to watching this... Fixed a lot of my concerns. It started getting a bit more like react redux toolkit, and coming from react, I flowed easily. Thank you

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

    wow this trick improves my codebase a lot! please share more tricks like this :)

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

    i think u should create a series ,where u review viewers angular and fix / teach best practice

    • @BrandonRobertsDev
      @BrandonRobertsDev  Год назад +2

      That might be interesting. Most people's code isn't open source and available to see. Also best practices are subject to change so I wouldn't want it to be a pile on session based on previous knowledge.

  • @the.maciota
    @the.maciota Год назад

    Nice video, so clean and easily.... Bro as you import all when pasted the code? exactly in 32:30

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

      What do you mean? It's VScode doing the imports unless I already had them in the file

  • @aymanhamedmoustafa
    @aymanhamedmoustafa Год назад +2

    I want to know your opinion about NGXS? which state management do you prefer to use??

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

      I'm bias to NgRx of course but NGXS is another good option also

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

      @@BrandonRobertsDev till now, I can not take a decision which one to use, NgRx seems to have more clear entities, up-to-date angular version, more community, on the other hand, NGXS seems to be more easy to code, could you plz tell me, the reason why u prefer using NgRx

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

      I'm not going to tell you not to use NGXS. I can only tell you that NgRx is well taken care of also and used in some of the biggest Angular projects around including ones inside Google.

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

    Thanks, Brandon. I did a little refactoring based on this video and it looks awesome :D

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

    I haven't used ngrx/store in a couple of years cause i've switched to component-store and I must say I'm blown away by what it became!! I think you convinced me in 40min to switched back to ngrx/store :D
    Also, you mentioned the inject() allowing easier testing, do you have any content (articles, videos...) about testing modern ngrx?
    Thanks for sharing Brandon!

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

      Thanks Kevin! Glad you find ComponentStore meets your needs also! I don't have any blog posts or videos on testing the functional effects yet, but essentially its a function that returns an observable.
      For example:
      someEffect$ = createEffect((actions$ = inject(Actions)) => actions$, { functional: true })
      could be called in a test as
      someEffect(mockActions$)
      So you can pass in all the mocked dependencies upfront without using the TestBed

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

    How does this approach (especially when you get to the vm), impact possible uyse of ComponentStore, and is this preferred now with 15.2?

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

      It doesn't change anything about how you use ComponentStore, as its just another thing you can inject. This is showing what you could do, but you don't have to switch to doing things this way.

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

      @@BrandonRobertsDev Is there any opinion on preference going forward from inside the team? What i really like about CS is that it makes feature stores a separate concern which then simplifies the global store and (in my mind, therefore also the domain model)

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

    Angular have better structure by segregation.. that looks awesome if we ignore css and spec files as like nest js🎉

  • @nguyentruonganhkiet8029
    @nguyentruonganhkiet8029 Год назад +2

    Hello Brandon, can you please make a small application about angular and ngrx in a new style? can help people learn in a new way

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

      I'll see if I can put that together

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

      I would also love to see this repository!

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

      @@johnc0de here's the GitHub repository I used for the example in the video
      github.com/brandonroberts/single-file-ngrx

  • @mohamedal-qadeery6530
    @mohamedal-qadeery6530 Год назад

    can you make video of ngrx for beginners ? and thanks you content is awesome

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

    I'm probably not seeing the whole picture of this, so anyone feel free to correct me.
    Why would developers want to have everything in one single file? With the very basic example you are writing in this video, you already have more than 90 lines of code..., imaging in a real application where, let's say we have 10 actions, 10 reducers, and out of the 10 actions, 6 are effects... having that in one file doesn't sound smart to me.
    Does the expression "Divide and conquer" doesn't make sense anymore?
    As I said, probably I'm not seeing the full picture, and I'm forgetting something...

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

      You're correct. The goal of the video was to highlight functional effects and it being the last piece of the puzzle to put a feature state in a single file.
      Think of it as a starting exercise. You can see how the pieces flow together in a single file, then move them to their respective places.

    • @aram5642
      @aram5642 Год назад +2

      You don't have to :) moreover, in more complex enterprise apps you should probably avoid that. But this video is a great example of recent functional api additions that allow you to write succinct code. As your code grows, you are still free to split the code into chunks.

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

      Well said!