Ngrx Store Tutorial for Angular - Learn State Management for Angular

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ • 501

  • @reidyoung298
    @reidyoung298 6 років тому +5

    I've worked with React in the past and needed a crash course in Angular for a client. All of your course have been immensely helpful. Thank you so much, Gary!

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

    You simply have blown by mind, this tutorial is simply more than AWESOME! SUPER AWESOME.
    In a nutshell, I ran helter-skelter from one website to another to get the hang of NgRX but in vain, then I bumped into this tutorial which NOT ONLY cleared up my all doubts surrounding this topic BUT ALSO gave me a SOLID foundation to this topic. Thanks a TON buddy!

  • @andrey1de
    @andrey1de 6 років тому

    Hey mr. Simon , don't ever see bed comments. You are now my binoculars for wide Angular World. Awesome movies , so clear and laconic. THANK YOU !!!

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

    The way of explanation is very super. I learned Ngrx store in just few minutes. Thank you so much. Keep posting new videos man

  • @code_overflow
    @code_overflow 3 роки тому +5

    I am new to it NGRX. I am following this tutorial but getting this error. I tried a lot but getting this error, can anyone plz help to fix the issue. Kindly help. Thanks in advance.
    Type '(state: Tutorial[] | undefined, action: Actions) => Tutorial[]' is not assignable to type 'ActionReducer'.
    Types of parameters 'action' and 'action' are incompatible.
    Type 'Action' is not assignable to type 'Actions'.
    Property 'payload' is missing in type 'Action' but required in type 'RemoveTutorial'.
    22 tutorial: reducer
    ~~~~~~~~
    src/app/actions/tutorial.actions.ts:20:17
    20 constructor(public payload: Tutorial) { }
    ~~~~~~~~~~~~~~~~~~~~~~~~
    'payload' is declared here.

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

      did u get the solution? even i am stuck at same error

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

      Please mention if you got it resolved

    • @HAL-mg4wy
      @HAL-mg4wy 3 роки тому

      I have the same error, sigh.

  • @ianbaker1101
    @ianbaker1101 5 років тому

    As someone who rarely comments I found your appeal to leave a comment to be compelling in that you did not care even if it was bad. Your videos are incredibly rapid fire and informative. I think that those who complain they aren't masters of the content you're purveying at the end of the video aren't being realistic. I often find that I've gone for 5% mastery to 30% by the end of any given video of yours. With further mastery being harder and harder to attain of course its still an excellent jump off point into leveraging these technologies in one of my projects.

  • @FreddyVizzel
    @FreddyVizzel 6 років тому +55

    Use filter instead of splice method in reducer to remove a tutorial to keep the old state immutable

    • @mquanit
      @mquanit 5 років тому

      in this case their tutorial model must have an id property for comparison

    • @DamascoMatheus
      @DamascoMatheus 5 років тому +5

      @@mquanit You can use the iteration index for comparison. Ex: state = state.filter((el, index) => index != action.payload);

    • @alisawari0
      @alisawari0 5 років тому +4

      exactly! he didn't even uphold the design patterns of flux architecture, the state is read-only.

  • @priyamganguly
    @priyamganguly Рік тому +1

    Excellent tutorial, especially for beginners. All the fundamental concepts are explained and shown so nicely. An additional perk, the coursetro website where everything is written and described clearly. It can't get any easier. Thanks, Simon for bringing out this tutorial.

  • @tommyC1V8
    @tommyC1V8 6 років тому

    Nice to have a good tutorial, that manually shows step by step how NgRx store works. Good job!

  • @TheUnarmedCivilian
    @TheUnarmedCivilian 2 роки тому +10

    For those of you going through this tutorial and you get to the part where he's putting the reducer into the app.module.ts and you get an error. Try this, it works for me.
    StoreModule.forRoot({
    product: reducer
    } as ActionReducerMap)

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

    Great tutorial really explained well. I've watched multiple tutorials and this was the easiest to follow

  • @ctsantosh
    @ctsantosh 4 роки тому +1

    Hi Gary,
    This is really quick and simple starting for NgRx. Thanks for keeping it so simple and clean.
    It really helped me to understand basic concepts.

    • @ctsantosh
      @ctsantosh 4 роки тому

      In your tutorial, You haven't explained where exactly this store will be stored. & what is the max limit etc.

  • @problemchild959
    @problemchild959 4 роки тому +1

    I find it amazing that everyone is ripping apart the way he does things in this video. it was TWO years ago and TEN versions ago. come on people things were way different back then.

  • @hansschenker
    @hansschenker 6 років тому +4

    Simon wants comments:
    before showing the code i would suggest to mention conepts like 'one way data flow'....
    next video: as you mentioned: NgRx Effects (handle side effects)
    next video then: NgRx Enitities: help us with useful functions for CRUD operations
    next video then: NgRx Schematics (remove the writing of the boilerplate code)
    Thank's Simon and keep on!

  • @satindersinghgill310
    @satindersinghgill310 6 років тому

    This is simply the best and easy explanation of ngrx store. Thanks Gary.

  • @shamimhossain551
    @shamimhossain551 5 років тому

    Whatever I want to learn new thing in Frontend I always look for your most effective tutorials, Thank you very much

  • @rahulmukherjee856
    @rahulmukherjee856 4 роки тому +2

    This tutorial is very clear and to the point. Loving it.

  • @samuelcheung938
    @samuelcheung938 6 років тому

    I used to use Vue and React to build web and SPA. now I am learning angular6, rxjs from your video courses. thanks a lot.

  • @ChasedYeti
    @ChasedYeti 6 років тому +39

    I've watched several of your Angular tutorials over the last few days. You do a great job and I really appreciate you doing them. One suggestion.. it would be helpful if you picked real world scenarios to model with your tutorials. Call an object "Users" instead of "tutorial". Perhaps you could pick a consistent scenario (ex. Car Sales Company, etc) that you apply to all of your tutorials so people watching over time would get to learn how each technology would fit into the overall design puzzle.

    • @David-sl1rr
      @David-sl1rr 4 роки тому +5

      A tutorial is a real world model

  • @rafvandenbosch5808
    @rafvandenbosch5808 4 роки тому

    followed your video, then looked at written version. And makes sense now. Greetings. Thanks.

  • @oswaldoolea2889
    @oswaldoolea2889 4 роки тому

    paced at perfect speed (narration), clear (simple), concise (short), to the point (no extra staff that isn't related or helps). This topic until not having gotten a grasp on it, can be difficult to conceptually understand, but you were able to make it normal! 2020 suppose to be the year of Ngrx in Angular(at least that was said in the ngrx conference 2020), so maybe it just needs to be upgraded as to the part when you install @ngrx/store into the app: app.module.ts -> imports -> StoreModule.forRoot(reducers, {.... which is an upgraded part when installing @ngrx/store

  • @Ursclip
    @Ursclip 4 роки тому

    Very useful. Was able to connect pieces. This was 3rd tutorial I watched on ngRx.

  • @napoleonnilo6469
    @napoleonnilo6469 6 років тому

    what an excellent display of greatness mr gary simon.

  • @munapadhi8723
    @munapadhi8723 6 років тому

    gary simon is one of my best instructure.

  • @qweacker123
    @qweacker123 6 років тому +1

    You are making the best Angular tutorials I know! Keep it up!

  • @scottremsen
    @scottremsen 4 роки тому +1

    Best wishes for a happy holiday season. I appreciate your courses and appreciate your style. I like that we can follow the written version. Helped at the office for training and code samples/repository help, along with your knowledge and tutorial style 👌. Will contribute here during this holiday season 2020 so you can get a few six packs. Good work...thank you for sharing your knowledge here!

  • @sveinsoermo9883
    @sveinsoermo9883 6 років тому

    Thx a lot Gary, U'r videos are great and the quality is excellent, also the Observer one was very good. U'r in my opinion among the 5 best on UA-cam today.

  • @jasonbelcher4476
    @jasonbelcher4476 6 років тому +27

    Nice tutorial! Only thing I would do is make the REMOVE reducer actually immutable with this : const newState = [...state.slice(0, action.payload), ...state.slice(action.payload + 1)];

    • @itayperry8852
      @itayperry8852 4 роки тому +1

      Indeed! A reducer function must be pure :)

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

      @@itayperry8852 Too bad spread operator is not viable for that. It creates a shallow copy, so any nested objects inside actually still refer to the same object in memory.

  • @yogansbuild_doc2007
    @yogansbuild_doc2007 5 років тому

    Fantastic for the intermediate developers. Very concise and compact. Appreciate it.

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

    Excellent material, really nice delivery. Highly recommended!

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

    This was easy to follow and explained very well, what an excellent Angular tutorial!

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

    Thanks a lot, this tutorial helped me in solving a problem I was facing for 2 days. Great stuff, I am grateful.

  • @Bargains20xx
    @Bargains20xx 6 років тому

    one quick tip : the spread operator works only if your object is one level deep, for example z = {name: John, value: 10}. If your object has objects inside of it instead of primitive data it leads to weird behaviours. Use lodash deep copy instead

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

    Splice function is not working in the current angular/javascript version. I used the following and it worked fine: state = state.filter((el, index) => index != action.payload);

  • @mateenahmedkhan3780
    @mateenahmedkhan3780 4 роки тому +2

    so clear so basic, this is what i was looking for, Thanks a million!

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

    You made it look so easy Gary.Thanks!!

  • @Ravivit9
    @Ravivit9 5 років тому +1

    Good tutorial for beginner to understand the concept. Thanks for the tutorial

  • @bhuvaneshparthiban9591
    @bhuvaneshparthiban9591 6 років тому

    ultimate, best tutorial for angular with redux

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

    Would also love to see effects and feature selector here.
    One of the best state management videos I have come across. Loved the way you explained.

  • @kennethkwakye-gyamfi4765
    @kennethkwakye-gyamfi4765 5 років тому +1

    It's a good read and it was helpful to me (particularly because I have some level of experience in Redux). But I'm more concerned about a beginner who doesn't know what state management is and how to work around state management.

  • @joshbose7495
    @joshbose7495 4 роки тому +1

    Great video for beginners as well. Definitely help me understand the actions and reducers concept and how to dispatch an event to the store. Thanks a lot

  • @3nt3_
    @3nt3_ 4 роки тому

    He is right, not enough people comment on the videos.

  • @mohammedelsuissey1745
    @mohammedelsuissey1745 6 років тому

    I have nothing to say but I'm leaving a comment because you deserve at least it...
    Diffidently suggesting your channel to all my friends in the field...

  • @prateekbhardwaj9943
    @prateekbhardwaj9943 4 роки тому

    Good color theme , background music ..good teacher

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

    Nice tutorial with nice example. It's clean and simple. Thank you very much.

  • @beebumble2166
    @beebumble2166 6 років тому

    Watching for while now, your videos are very good... I even subscribed to your blog Coursetro... Keep up the good work!!!

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

    Appreciate it, simple and short as always

  • @brunoccs
    @brunoccs 6 років тому +70

    Honestly you just wrote some code that works but didn't really explain anything. I've followed both the video and the written tutorial and still have no ideia how this code works.

  • @DarshanShah838
    @DarshanShah838 4 роки тому

    Nice work!. I hope you explained more about the use case of this in real world versus database and also one of the variable has ... (3 dots). Not sure what that was. BTW, your voice is so good to hear

    • @problemchild959
      @problemchild959 4 роки тому

      the 3 dots is called a spread operator developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax

  • @dominuskelvin
    @dominuskelvin 6 років тому

    Gary your explanations are awesome. I have learnt a lot. Thumbs up bro.

  • @harishrawat4218
    @harishrawat4218 6 років тому

    Awesome video Gary ! not sure if you have covered a video effects along with actions and reducers. If yes please share details.

  • @nicolaschetty3036
    @nicolaschetty3036 6 років тому

    Thanks for taking the time to make the video and sharing your knowledge! Much appreciated

  • @creativeplanet2820
    @creativeplanet2820 4 роки тому

    So, after doing Vuex with vue js and redux on react native, I was able to quickly wrap my head around this, then earlier last year I came here for ngrx. Vue js things much more easier, i guess. And nice explanation as well.

  • @Destort
    @Destort 6 років тому +4

    Hi Gary, is there going to be a part 2 to this tutorial with @effects? Even the most basic tutorials don't make as much sense as yours. Thanks for all that you do!

  • @bowmanbig9653
    @bowmanbig9653 5 років тому +1

    Thanks got a good into to ngrx to start working on it .... pls continue the good work...

  • @pawansahu9130
    @pawansahu9130 4 роки тому

    Can you please explain why you have used square brackets while initializing the const ADD_TUTORIAL

  • @flage990
    @flage990 5 років тому

    Your tutorials really helped me learn Angular. started a month ago and its really going well. Thanks!

  • @Aoubaker
    @Aoubaker 4 роки тому

    Your tutorial make complicated things very simple thanks a lot 👍

  • @donaldjunior1442
    @donaldjunior1442 4 роки тому +1

    Amazing stuff. This would be a little harder for someone without any angular experience but for one that has a little, least how to spin up a small app while accessing services directly in components, this is a good way to start the ng-store road. Also, anyone with react-redux experience can relate quite fast. I couldn't find the effects tutorial though.

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

    Good tutorial, gives basic knowledge on NgRx implementation... thumbs up

  • @rafael_walter
    @rafael_walter 6 років тому +2

    As always great job. But what if:
    1. A component displays within a *ngFor a list of objects - let's call this app-list
    2. A sibling component displays the detail of the selected object - let's call this app-detail
    3. The object may be edited from any of the components
    4. How to work in O(1) when editing the object on app-detail and reflecting on app-list.
    Known problems:
    1. We cannot save the object index from the app-list because the list can be filtered at any moment.
    How handle this case?

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

    Excellent course as always!

  • @johnragica1723
    @johnragica1723 5 років тому

    Really helpful explaining how reducers and stores work. Thanks!

  • @YousufZaman
    @YousufZaman 6 років тому

    your tutorials and step-by-step demo project creations are very helpful and awesome. :)

  • @shyamkumar4love
    @shyamkumar4love 6 років тому +2

    Thanks for this course man... I'm looking forward to get a course on deep dive into ngrx effects and combined reducers and so on .. as always.. awesome

  • @MrAkshay1438
    @MrAkshay1438 6 років тому

    You are just awesome bro... you have made it so simple to understand...Thank you..

  • @HarikrishnanKK
    @HarikrishnanKK 6 років тому

    Thanks for the vid! Small query being, @26.36, the state was directly mutated i guess. A spread operator with a filter on the index would have been the way to remove the item from array.

  • @Dryeyescrying
    @Dryeyescrying 6 років тому

    Solid content, superb pacing, easy to follow.

  • @pragatidugar
    @pragatidugar 5 років тому

    it was an awesome tutorial for basic intro to ng-rx and store, thanks a lot ,great work !

  • @lakshminaidu3123
    @lakshminaidu3123 4 роки тому

    Hi,
    I am getting the bellow error while fetching the data in ReadComponet.
    this.tutorials = store.select('tutorial');
    No overload matches this call.
    Overload 1 of 9, '(mapFn: (state: AppState) => Tutorial[]): Observable', gave the following error.
    Argument of type '"tutorial"' is not assignable to parameter of type '(state: AppState) => Tutorial[]'.
    Overload 2 of 9, '(key: "tutorials"): Observable', gave the following error.
    Argument of type '"tutorial"' is not assignable to parameter of type '"tutorials"'.ts(2769)
    Please help me how to resolve.
    Thanks in advance

  • @tulasik9571
    @tulasik9571 4 роки тому

    great beginners tutorial for ngrx. is there a tuturial for initializing the initial state of the model from backend? would be great .

  • @Ramblewithmme
    @Ramblewithmme 4 роки тому

    Is state get cleared on browser refresh?

  • @imhappynow8471
    @imhappynow8471 5 років тому

    Million Thanks man. Love your videos. Please Never Stop lol.

  • @rizwanijaz6722
    @rizwanijaz6722 5 років тому

    Its a great video to understand basics of Ngrx Store

  • @Thedelfinkoo
    @Thedelfinkoo 4 роки тому

    What if we have select box? How to get and show value from select box? Thank you!

  • @haroldcjennettiii
    @haroldcjennettiii 4 роки тому

    Why at 12:12 is 'initialState' in square brackets?

  • @Artur-lb8nq
    @Artur-lb8nq 5 років тому

    on 18:30 you are defining const tutorial in a constructor of a component ? I just did not see this practice anywhere, why not on ngOnInit ?

  • @SampathLokuge
    @SampathLokuge 5 років тому

    Awesome! Thank you. But no effects video yet?

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

    im starting to get the sense out of NGRX. thank @Gary

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

    i keep on getting this error - 'types of parameters 'action' and 'action' are incompatible.'' donno what to do

  • @eighties8
    @eighties8 5 років тому

    Simple and straight forward to get the "gist" of ngrx/store. Quick question though, none of your typescript lines are terminated with ";" and my VS Code IDE complains. How do you set up your editor to handle that?

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

    Please make video on how to add 2fa in angular project

  • @vipulmalani1007
    @vipulmalani1007 5 років тому

    This tutorial help me to understand the ngrx concept. Really good video.

  • @nuryasin6615
    @nuryasin6615 4 роки тому

    You are the last one to be called terrible !

  • @tigrislaesus1245
    @tigrislaesus1245 6 років тому

    I tried to implement ngrx/Store with Angular but I am always getting the following error in console, and no content is showed:
    "TypeError: Cannot read property 'schedule' of undefined at ObserveOnSubscriber.scheduleMessage"
    By the way I am using: Angular CLI: 1.7.4 Angular: 5.2.11
    Please I need urgent help since I am stack into this issue..

  • @ivarnguyen7137
    @ivarnguyen7137 4 роки тому

    your tutorial is a bit different with angular doc's tutorial. On angular doc, it has file called selector. Can you explain what it's role and why your tutorial don't have it?

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

    Where would you put the db and logic interaction? In the component, reducer or actions?

  • @omineirotech
    @omineirotech 5 років тому +4

    It is a good practice put a '$' symbol at end of an observable variable to fast identification as Observable type. Following this way: tutorials$: Observable;

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

    Can I get video for ngrx-store-localstorage, and its flow of working

  • @anandakumarpalanisamy5558
    @anandakumarpalanisamy5558 6 років тому

    This is an excellent video - Gary..... Thanks for your time.

  • @rakeshnayak2072
    @rakeshnayak2072 6 років тому

    what will happen on refreshing the page? Does it reset the data or retrieve the existing data?

  • @Wentra_Roblox145
    @Wentra_Roblox145 4 роки тому

    Nice intro to NgRx for beginners. Thanks!

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

    Thank you! Nice and well explained.

  • @vannurgvs2819
    @vannurgvs2819 4 роки тому

    single shot learning curve...Can you provide video on entities and effects?

  • @bisiflora
    @bisiflora 4 роки тому

    wow this was great and straight to the point. Thank you

  • @euginesanthanasagayammanue3574
    @euginesanthanasagayammanue3574 5 років тому

    Excellent. i m very poorer student. and i m getting more information from you what i need for my really time project. keep it up.

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

    You are absolutely great

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

    Thanks for the course, you teach very well!!

  • @gavinmeier41910
    @gavinmeier41910 6 років тому

    This is a great video, I like how you leave it simple. It would be nice to show effects, sagas, selectors though

  • @gosnooky
    @gosnooky 5 років тому

    So every reducer function your app uses needs to be imported in the root component? Doesn't sounds like it scales very well.