Angular NgRx - How to use Feature Creator (API Overview, 2023)

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • Level up your Angular skills with my advanced courses 🚀
    bit.ly/advanced-angular-courses
    Angular NgRx library is the most popular state management library for Angular and in this video, I will cover one of its functions called createFeature. At the end of the video, you will learn how by using the createFeature function you can reduce the amount of boilerplate in your Angular application. It becomes possible because createFeature can generate a bunch of initial NgRx selectors at runtime, so you don't have to do it manually. This video was created in close collaboration with the NgRx core team. I hope you will like the video and learn a lot from this tutorial.
    🔗 createFeature official documentation:
    ngrx.io/guide/store/feature-c...
    🔗 Lesson Source Code (initial state in "main" branch):
    github.com/DMezhenskyi/ngrx-p...
    💡 Short Frontend Snacks (Tips) every week here:
    Twitter - / decodedfrontend
    Instagram - / decodedfrontend
    LinkedIn - / dmezhenskyi
    🕒 Time Codes:
    00:00:00 - Intro;
    00:00:25 - Feature Creator Overview;
    00:11:28 - Outro;
    #angular #ngrx
  • Věda a technologie

Komentáře • 58

  • @DecodedFrontend
    @DecodedFrontend  Před rokem +1

    Level up your Angular skills with my advanced courses 🚀
    bit.ly/advanced-angular-courses

  • @vladyslavhryniuk4324
    @vladyslavhryniuk4324 Před 11 měsíci +4

    Your tutorial has added to the official documentation😯Good job!)

  • @franmerlini99
    @franmerlini99 Před rokem +12

    Thanks a lot! Didn't know about 'feature creator'. Would be nice if you can talk about how to structure an applicantion with multiple NgRx stores (and which are the best practices)

  • @HoofedComic
    @HoofedComic Před rokem +32

    Definitely want more 😀It would be really helpful if you make a video about ngrx component-store vs ngrx global-store - when to use which one, how to combine this two solutions, should I use both in one project etc.

    • @DecodedFrontend
      @DecodedFrontend  Před rokem +1

      Hi :) Thank you for the suggestion. Indeed it is an interesting topic

    • @LonelyWatcher
      @LonelyWatcher Před rokem

      Good idea

    • @SwamiSanapathi
      @SwamiSanapathi Před rokem +3

      ngRx Series would be good as well, I don't find any worth explanation about ngRx in the internet like you.

    • @peshaljha7646
      @peshaljha7646 Před 11 měsíci

      @@DecodedFrontend so are you planning to do a video on this anytime in the future..?

  • @nelson3391
    @nelson3391 Před 12 dny

    Great video! Thanks!

  • @Sevkingblade
    @Sevkingblade Před rokem

    I'm so grateful for your videos. You've definitely helped clarify some of the API I was curious about.

  • @SafetyLast-_-
    @SafetyLast-_- Před 10 měsíci

    Thank you! Great content as always. I use NgRx feature creators in my new project, so it was pretty useful to know that it's capable of.

  • @rafiquemohammed3029
    @rafiquemohammed3029 Před rokem

    AWESOME!! i know about createFeatureSelector but dint know about createFeature. Thank!

  • @ansumanmishra9608
    @ansumanmishra9608 Před 9 měsíci

    Excellent explanation!!

  • @rembautimes8808
    @rembautimes8808 Před 8 měsíci

    Great video useful for internal banking applications where there are a ton of fields to juggle around

  • @alexd3227
    @alexd3227 Před 4 měsíci

    Thank you Dmitry, for your dedication and passion for web development and Angular in particular. It is a pleasure to watch your videos!

  • @gagiksimonyan3782
    @gagiksimonyan3782 Před rokem

    Thanks for another useful video, Dmytro

  • @pepikkk10
    @pepikkk10 Před 6 měsíci

    super trick thank you SO much !!!

  • @yehorchrn9064
    @yehorchrn9064 Před rokem +1

    More NgRx tricks please!

  • @alphamarouanadiallo8238

    Just thanks you !

  • @nerdobject5351
    @nerdobject5351 Před rokem

    Great video. Was unaware of this. Our front end stack is full of repeated selectors. Going to try this out.

  • @PauloSantos-yu1tn
    @PauloSantos-yu1tn Před rokem +4

    NGRX store is one of my favorite libs of all time.

  • @brawlboy1382
    @brawlboy1382 Před 2 měsíci

    Thanks. I am using provideStore(reducers) but not using provideState, it is still working.

  • @AdrianRomanski
    @AdrianRomanski Před rokem +1

    Another Great Video!!

    • @DecodedFrontend
      @DecodedFrontend  Před rokem

      Thanks, Adrian. Glad you enjoyed it!

    • @AdrianRomanski
      @AdrianRomanski Před rokem

      @@DecodedFrontend Have you thought about creating a testing series?? :D

  • @balajibalamurugan8053

    We need a ngrx course 🔥

  • @desafiosdev
    @desafiosdev Před rokem

    Incredible, I have some projects with big states, lots of parameters and a huge .selectors file. I will refactor

  • @beodan9219
    @beodan9219 Před 11 měsíci

    Greate

  • @vkiperman
    @vkiperman Před rokem +1

    I love this channel! If possible, can you do a deep dive into how animations actually work under the hood? Thanks!

  • @bonnes04
    @bonnes04 Před rokem

    Great Video as always.... ngrx data and component store are simpler form me

  • @biswajitpaul6123
    @biswajitpaul6123 Před rokem

    Great job 👍. Is it support other state selectors as parameters in extraSelectors?

  • @haroldpepete
    @haroldpepete Před rokem

    nice, but you may use the selectot to file to declare custom selectors and later import them to createfeatures and it looks cleaner

  • @alexmatveev7730
    @alexmatveev7730 Před rokem

    Cool stuff. Thanks a lot for your explanation, but how about tree shaking? You include all stuff like - import {blabla} from 'blabla', but you can use not all of it.

  • @YYLL-xh9ez
    @YYLL-xh9ez Před 7 měsíci

    Дякую, земляк!)

  • @sergeypodgaysky8551
    @sergeypodgaysky8551 Před rokem

    Hi Dmytro, what do you think about ngneat/elf state management library? Would you use it personally or in enterprise level apps? At first glance it seems very promising given the features it has

  • @MahmoudTarek-pz1rl
    @MahmoudTarek-pz1rl Před rokem

    It is really a great content and of course i'd love to see more of it.
    But i've recently came across a new method in ngrx called selectSignal, so a question came up in my mind..
    Does this feature support dealing with signal based state or not,
    also i wonder if the ngrx will depend more on signals in the future!

  • @amosisaila8416
    @amosisaila8416 Před 6 měsíci

    Great video, but how you set multiple features in the provideState()?

  • @genyklemberg
    @genyklemberg Před rokem

    Thanks for that. Please let us know how PWA should be created with GraphQL and if there any issues that can arise?

  • @VenelinManchev
    @VenelinManchev Před rokem

    How do you mock these selectors for components unit tests? Is it still a valid case to use mockStore.oveerideSelector() method?

  • @viralmoney8619
    @viralmoney8619 Před 10 měsíci

    Hi sir.. is it not possible to use it like redux toolkit?
    Could please make a playlist for ngrx with signal?🎉

  • @boris8983
    @boris8983 Před rokem

    sometimes we need to pass values to our selectors like this: const selectFoobar = ( foo: string ) => createSelector(...)
    Is this something you would avoid doing anyway or would this still be possible (if it would, how?)

  • @tomaszkumiega4325
    @tomaszkumiega4325 Před 7 měsíci

    Can we have multiple createFeature() in root state? How to achieve that?

  • @user-ij5qr7gd4x
    @user-ij5qr7gd4x Před rokem +1

    Can you make a video on nx monorepo?

  • @balintcsaszar6831
    @balintcsaszar6831 Před rokem

    Note:
    1. when we are working on a library, there could be name collisions, for example we are using loading flag in StateA and in StateB too. In this case we have to rename it to loadingStateA or smtg.
    2. in unit testing point of view, it can spare some tests, I wonder how the coverage report looks like if I test only 1 selector from extraSelectors block, I mean it will be 100% or not -> I will figure out today 😅
    3. thanks for the video Dmytro 🙂

  • @Andrew-zv1vw
    @Andrew-zv1vw Před rokem +3

    Hi from California! Slava Ukraini!

  • @mustafadagloglu2071
    @mustafadagloglu2071 Před rokem +2

    I'm writing Angular for 3 years. I worked on lots of projects, and I still don't understand what does NGRX solve? Angular has state management with the services already. You can define your services in any scope, and do exactly what these libraries do. This way it looks like too much React imo.

    • @ATTI0822
      @ATTI0822 Před rokem

      I can agree with you. I worked with ngrx and service base approach in a quite big application.. and it was enough to deliver the features. So it is still a question for me as well

    • @mustafadagloglu2071
      @mustafadagloglu2071 Před 11 měsíci

      @@user-if1de8pt2j IDK much about the NgXS. The problem is creating simple services for state management is generally simpler than lots of library boilerplate. You can create generic state services to avoiding create similar services. In my case, I do not reset the state manually, the state service will be destroyed with the component already.

  • @Dimonina
    @Dimonina Před rokem +1

    I stopped using ngrx in 2019, because of the huge amount of boilerplate code. Now I can see 4 years later they're still fighting against it :))

    • @Dimonina
      @Dimonina Před rokem

      @@user-if1de8pt2j yep. I found that any other store implementations are much better than this "industry standard". For my projects I prefer elf now. Very simple and super extensible.

  • @porter6287
    @porter6287 Před rokem

    *promosm*

  • @regedam7559
    @regedam7559 Před rokem +2

    createActionGroup() також зручний тул для групування actions. Дозволяє уникнути певної к-сті бойлерплейту
    Також цікаво було б подивитись відео про @ngrx/entity, @ngrx/data
    Дякую за контент! Слава Україні!

    • @DecodedFrontend
      @DecodedFrontend  Před rokem +1

      Героям Слава!🇺🇦 Дякую, за коментар. Так, згоден з приводу action groups

  • @andyhb1970
    @andyhb1970 Před 8 měsíci

    Great video thanks for sharing, can I ask why you exported the scientistFeature from the scientist.reducer.ts file and not from the scientist.selectors.ts?