React Redux Tutorials - 7 - Store

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

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

  • @yokaigamestudio463
    @yokaigamestudio463 4 года назад +73

    You are really the best at explaining redux. I've watched 5+ others but this is so clear.

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

      you prolly dont give a shit but if you're bored like me atm you can stream pretty much all of the new series on InstaFlixxer. I've been streaming with my girlfriend for the last couple of months xD

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

      @Cesar Michael Yea, I have been watching on InstaFlixxer for since december myself :D

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    Honestly really impressed by how you're breaking this down. Gave me perfect clarity. I had previously tried figuring out what all this was doing just by looking at previously created code and was completely lost. Your video series has helped so much

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

      I am in the same situation. I've been presented with a new React codebase and I have been completelly lost for a week now.This videos are making everything more and more readable

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @swarnimsharma3717
    @swarnimsharma3717 4 года назад +27

    Hats off 2 u such a great explanation i really needed this , i have watched all your videos of react , hook , redux , very nicely explained keep it up thanku

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

      Hi Swarnim! Are you a student or working currently? Would you be interested in software developer opportunities?

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

      @@shivanigaddagimath6105 yes I want..

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

      @@jiteshjoshisde3154 Hi Jitesh! Can we please get in touch through LinkedIn or gmail? Just search for Shivani Gaddagimath on LinkedIn and request to connect please. The first profile that pops up is mine.

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

      @@jiteshjoshisde3154 Hi Jitesh! Please get in touch with me on LinkedIn if interested in the opportunity.

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @FatmavHassan
    @FatmavHassan 11 месяцев назад

    Thank you so much this is the first time in my entire life to understand the concept of redux.. all the best for you

  • @nihaltiwari2479
    @nihaltiwari2479 4 года назад +6

    vishwas sir i don't know how should i thank you cause i have followed plenty of tutorials from very famous channel of programming like Traversy Media, Mosh Hamidani but no one explained the redux as easy as you did thank you so much for this i was really struggling to learn redux but now it feels like wow

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

      Hi Nihal! Are you a student or working currently? Would you be interested in software developer opportunities?

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

      @@shivanigaddagimath6105 pls comment here if you have any frontend dev opportunities

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

      @@sourabhkumar3852 Hi Sourabh! We do have opportunities available for freshers and experienced developers. Kindly connect with me on LinkedIn. Find my contact information on my channel.

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @Arjun-ll7zg
    @Arjun-ll7zg 3 года назад +1

    You are explaining each concept clear and which good pace (not too fast not too slow.) , Thanks for it brother.

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

    Thank you for this simple, short step by step videos for understanding Redux, I am learning this in my training at work!

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    Fix to all your errors,
    const redux = require('redux');
    const createStore = redux.createStore()
    // replace the above two lines with the one below
    import { legacy_createStore as createStore} from 'redux'
    also add this
    "type": "module",
    to package.json after
    "description": "",

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

    i just started, but i believe it's a pure gold. Thank u a lot for this videos. I starting thinking that i can understand redux with your help.

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

      don't understand line no 32 why const unsubscribe u write ?????

    • @itxchiii
      @itxchiii 2 месяца назад

      @@vishwajeetyadav4480 he's storing subscribe method in a constant, and then calling it at the end to unsubscribe.
      "to unsubscribe from the store, call the function returned by the subscribe method

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

    Finally i understood after watching so many tutorial i find your tutorial the best thanks bro 😍

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @riyajha559
    @riyajha559 4 года назад +1

    man hats off to you, what a great explanation and correlating things with a real-life example, finally understood the redux pattern, thank you so much.

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

      Hi Riya! Are you a student or working currently? Would you be interested in software developer opportunities?

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    Thank you for explaining. This is the best redux explaining I have ever seen

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

      Hi Samir! Are you looking out for software development roles currently? Where are you based?

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

      @@shivanigaddagimath6105 Hi Shivani. Yes

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

      @@samirvaliyev Hi Samir! Thanks for showing interest. Can we please connect on LinkedIn or gmail for more details? Please search Shivani Gaddagimath on LinkedIn and request to connect. The first profile that pops up is mine.

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @sherifkhattab1313
    @sherifkhattab1313 5 лет назад +8

    I don't get it why this channel has far less subscriptions that what it deserves !!!

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

    He's not from this planet, really appreciate his work

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

    So put in simple terms ,the below is the Redux essence or pattern
    1)we create a store
    2)declare the initial state and the reducer
    3)define the actions and action creators
    4)subscribe to the store
    5)dispatch actions to update the store
    6)And finally unsubscribe to the changes (in the store).

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @prisinha
    @prisinha 2 года назад +11

    1:11
    getState() function = allow access to state,
    dispatch(action) = allows state to be updated,
    subscribe(listener) = registers listener

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

      don't understand line no 32 why const unsubscribe u write ?????

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

      @@vishwajeetyadav4480 where written unsubscribe ?

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

      @@prisinha yes why hi written const unsubscribe?

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

      @@vishwajeetyadav4480 not able to understand your question

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

      @@prisinha 😕

  • @MuhammadUbaidAshrafCh
    @MuhammadUbaidAshrafCh 11 дней назад +1

    common mistakes that could happen to beginners: the case of import statement and function to create store should be same. For example if you import Redux from 'redux' then redux.createStore won't work, use Redux.createStore or import it as redux instead of Redux. Second this is passing action function name in the reducer function that will result in undefined rootreducer, the arguments passed should be (state="state whatever it is", action).... Another thing is when you initialize the createstore at the top then dont pass () with it as it will return an undefined error. At the top where it is defined it is defined simply as redux.createstore and at the end when store is created, reducer is passed as argument to it within paranthesis

  • @Mot-cong-mot-la-hai
    @Mot-cong-mot-la-hai Год назад

    Thank you so much, you are such a dedicated teacher

  • @spencer6959
    @spencer6959 4 года назад +2

    Thanks so much! This is the first time the light switched. Superb teacher.

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @shahotoofani9913
    @shahotoofani9913 5 лет назад +5

    Thanks a lot! Please consider Redux Sagas in your upcoming lessons

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @safalpatel2839
    @safalpatel2839 4 года назад +1

    It was a crystal clear explanation. Thanks dude...keep up😎

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

      Hi Safal! Are you student or working currently? Would you be interested in exploring software development job opportunities?

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

      @@shivanigaddagimath6105 Hello shivani, I am currently pursuing pgd but would love to explore about opportunities. Let me know if any!!

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

      @@safalpatel2839 That's great! Can we please get in touch through LinkedIn or gmail? Just @ Shivani Gaddagimath on LinkedIn and request to connect please. The first profile that pops up is mine.

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @aakashsharma7653
    @aakashsharma7653 4 года назад +1

    now i got the idea of redux
    thanks a lot

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

    you really know what you are doing, you are great at teaching...congrats, and thanks a lot

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @kresimircosic3753
    @kresimircosic3753 4 года назад +11

    For anyone getting the error:
    Reducer is not a function
    1) Just remove the 2nd line of code completely, it's totally unnecessary.
    2) Where it said (like line 30-ish):
    const store = createStore(reducer)
    Put:
    const store = redux.createStore(reducer)

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

      @Obscure Anonymous I have no idea, it's been a long time, maybe the API changed not sure. Even though I think it should work, he was just passing a reference to the method from redux package. Sorry I couldn't help in answering lol. Maybe even destructuring could work, instead of doing what I said, try on his 2nd line to write:
      const { createStore } = redux;
      Leave the bottom part as his, because in my head now it should work, but ofc it might not xD

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

      Thanks man

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

      Thanks Bro

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

    Understood this in one go!

  • @NoumanKhan-ck7vx
    @NoumanKhan-ck7vx 2 года назад +1

    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

  • @zaidsaiyed6076
    @zaidsaiyed6076 4 года назад

    By far THE best tutorial on redux
    ...keep it up sir😎

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @luis.carlosrodriguez1561
    @luis.carlosrodriguez1561 3 года назад +2

    hey there, great REDUX video, amazing training. one question: line 31 returns an 'UNDEFINED' everytime I run but when you run the same code, you get the initialState. confused...
    thank you for the series.

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

      Where you got const reducer = (state, action) => {, just add const reducer = (state = initialState, action) => {

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    Thanks for the amazing videos!
    If we dispatch buy cake after unsubscribing, the state wouldnt change?

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

    i didnt understood this fully one doubt please clarify it: when store.dispatch method is called how the store.subscribe method will get called??

  • @reflextionsdev
    @reflextionsdev 2 года назад +6

    createStore is deprecated, can you update for configureStore?

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

      same error. if you found the solution then please share.

  • @manishmohanani654
    @manishmohanani654 4 года назад +2

    This is on of your best tutorial. Loved the way you teach sir.
    Please make tutorial on React flux as well.🙏🏿

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

      Hi Manish! Are you looking out for jobs in software development currently? We are in search of developers to join our team.

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

    bro you are only 9 views away from 150k views on this video, i will complete that ... Best redux tutorials i had ever seen on any where on the internet. may you get what you want in your life ... Hare krishana ...

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @lalitkumarmehta1721
    @lalitkumarmehta1721 4 года назад +1

    Thanks a lot, bro for this awesome explanation

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

      Hi Lalit! Are you a student or working currently? Would you be interested in software developer opportunities?

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

    Hey Vishwas, First of all, thanks for creating this series, you are very good at explaining things. I have one question about tutorial 7, where you created the store and used the subscribe method but why did you assign the subscribe method to unsubscribe variable and where did this unsubscribe function come from in the last line??

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

      i guess you should code this way cause it works as expected

    • @RakeshSingh-yd7xo
      @RakeshSingh-yd7xo Год назад

      I am also confused about it.

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    I like this video. And I'm one of those idiots who learn react and redux at the same time. So, I thought this things are broken because programming for a very long time, I have witnessed the 'evolution' of programming languages, assembly to c, c++, python - as we go higher, we have less things to type and deal with. But after watching this, it looks a lot less broken ... but it is still!. I'm from an object oriented team, so that 'buyCake' function should be doing remote calls, manage the error handling and take care of emitting 'SUCCESS' and 'FAIL' scenarios, and also when it is a 'SUCCESS' scenario, the buyCake should update the current inventory and shopping cart, that means being able to fire two actions, and maybe fire another action like print receipt. This logic is not a button's responsibility.

  • @ericanmolkandulna6628
    @ericanmolkandulna6628 4 года назад

    Best and Easy Explanation.
    Love Your Videos
    Thanks

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    great explanation step by step

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

    very well explained

  • @mohiniraut14
    @mohiniraut14 4 года назад

    Excellent explaination sir.

  • @asmereg
    @asmereg 4 года назад

    You teach so well. Thank you so much

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @shujaali433
    @shujaali433 8 месяцев назад

    A pure gem ❤

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

    This is such quality content...Thank you

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @medmankatowice
    @medmankatowice 4 года назад

    Very nice and methodical.

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

    For buy cake you are creating one more object instead you change prop in state and return the same

  • @vishalmule9829
    @vishalmule9829 5 лет назад +1

    Always your video is awesome. Please Make example video create small website using react + react hooks + redux. using images and dynamic content.

  • @incognito_2512
    @incognito_2512 5 лет назад +1

    Hi really like your series! Can you please explain in more detail what subscribe and unsubscribe methods do?

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

    Thank you bro.

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

    best in class teacher

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

    What significance of Unsubscribe() method ??

  • @Gimmiyimmy
    @Gimmiyimmy 4 года назад +1

    Why you have not used ES6 Import statement and used require("redux"). Is there any specific reason, even you have used spread operator (...) of ES6.

    • @andrewcasarsa379
      @andrewcasarsa379 4 года назад

      watch from the beginning. he specifically addresses this.

  • @kirankumarahir7933
    @kirankumarahir7933 5 лет назад +2

    Please further this series with redux advanced concepts such as middlewares

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

      Hi Kirankumar! Are you a student or working currently? Would you be interested in software developer opportunities?

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    what is the visual studio code theme you're using?

  • @vijaydwivedi823
    @vijaydwivedi823 4 года назад +2

    Hello Thanks for the tutorial , i have one question :
    const reducer = (state = initialState , action)=>{
    switch(action.type)
    {
    case BUY_CAKE : return {
    ...state,
    numofCakes:state.numofCakes-1
    }
    we have assigned here state as initialState but action is just action , how reducer will come to know the i have defined my action function as well .
    Pls help

    • @javid1326
      @javid1326 4 года назад +1

      with action.type inside 'swith' parenthesis you start your action and define it with 'case' statement. case => BUY_CAKE

    • @Firosshamsudeen
      @Firosshamsudeen 4 года назад +4

      while dispatching we pass action object/action creator where we have the action defined which will reach to reducer, so reducer will understand this as its second param. Hope make sense.

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

      Hi Vijay! Good to see curious learners like you! Are you a student or working currently? Would you be interested to explore software dev roles?

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

    Thank you

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

    Explanation at the top of magnificence.

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

      don't understand line no 32 why const unsubscribe u write ?????

  • @fares.abuali
    @fares.abuali 2 года назад

    Thanks!

  •  4 года назад

    I think it would be better to introduce subscribe method before dispatch because dispatch won't work without calling subscribe method before.

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

      As per my understanding...whenever state gets updated/changed..then subscribe method gets called..so it doesn't matter if it's after/before dispatch..

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

    very good thanks

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

    HOLY GUACAMOLY THIS GUY IS THE BEZT

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

    Why should dispatch an action to update state and not update store directly?

  • @arindam1249
    @arindam1249 4 года назад

    amazing example

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

    Couldnot understand the subscribe part, when it gets called? Does it gets called automatically after dispatch method

  • @tech-tuts
    @tech-tuts 4 года назад +2

    I'm using "redux": "^4.0.5" and I need to mention `redux` as an object before createStore function as the following:
    const store = redux.createStore(reducer)
    Otherwise, I got ReferenceError: createStore is not defined.

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

      I guess you could destructure and import createStore from redux library too for it to recognize in global scope. something like import { createStore } from 'redux';

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

      @@kanikarungta4452 Hi Kanika! Are you a student or working currently? Would you be interested in exploring jobs in software development?

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    What is the font settings for your VSCode ?

  • @Abhishekkumar-vd5ov
    @Abhishekkumar-vd5ov 4 года назад +3

    after dispatching buyCake() how action calls the reducer?

    • @osamagamal495
      @osamagamal495 4 года назад +1

      i'm having the same question, but I think by calling createStore and passing reducer to it.

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

      Hi Abhishek! Are you a student or working currently? Would you be interested in exploring jobs in software development?

    • @Abhishekkumar-vd5ov
      @Abhishekkumar-vd5ov 3 года назад

      @@shivanigaddagimath6105 I am working but not looking for job change.

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

      @@Abhishekkumar-vd5ov Okay. Thanks for your reply.

  • @aman11srivastava
    @aman11srivastava 4 года назад +2

    I am facing this error:
    Initial state 10
    Updated state { numberOfCakes: NaN}
    Updated state { numberOfCakes: NaN}
    Updated state { numberOfCakes: NaN}

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

      Hi Aman! Are you a student or working currently? Would you be interested to explore software dev roles?

  • @techiesrikanth2447
    @techiesrikanth2447 4 года назад +1

    Hi bro.
    Are there any breaking changes from react-redux v6 to v7.
    For using react-redux with hooks

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

      Hi Srikanth! Are you looking out for jobs in software dev currently? We are hiring!

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

    What if I want to create 2 stores but I am restricted to give variable name as initialState for initial state, how to do that.

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

      Hi Piyush! Are you a student or working currently? Would you be interested to explore software dev roles?

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

    Can we not use local storage to pass data from one component to another or to store data. We can create our own class component which will work as a store and we can create our own get set methods in that particular class. How is that diff from redux ? Any one please clarify

  • @GurkiratSingh-pn6yu
    @GurkiratSingh-pn6yu 7 месяцев назад

    What reducer function do here ?

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

    When you type node index in terminal you are getting what you written in console am not getting it am a beginner can you explain me this

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

    Really awesome …

  • @javascriptwar9525
    @javascriptwar9525 4 года назад

    Sir what if we don't use subscribe..?

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

    can you make video on using redux with redux saga ?

  • @dohyun0047
    @dohyun0047 4 года назад +1

    reason why we do "cosnt unsubscribe = ~" is store.subscribe() returns a ""function"" for unsubscribing listener!

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

    Initial state undefined also

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

    sir, where are you from ???

  • @heninechi8828
    @heninechi8828 5 лет назад +6

    i had this error : "Expected the reducer to be a function."

    • @mizanalharun57
      @mizanalharun57 5 лет назад +23

      const redux = require('redux');
      const createStore = redux.createStore; [ here not redux.createStore(); ]

    • @heninechi8828
      @heninechi8828 5 лет назад

      @@mizanalharun57 thanks!

    • @bishnulama7520
      @bishnulama7520 5 лет назад +5

      remove line2 and replace line30 by
      const store = redux.createStore(reducer)
      It worked for me

    • @shashiprince
      @shashiprince 4 года назад +1

      @@bishnulama7520 thanks, this worked for me

    • @manthanpatel779
      @manthanpatel779 4 года назад

      @@mizanalharun57 thank you bro....... I was too confused...

  • @parasbuda9174
    @parasbuda9174 4 года назад +2

    Iam Facing a problem
    console.log("initialstate",store.getState())
    is giving undefined value
    but the const unsubscribe=store.subscribe(()=>console.log("Updated State",store.getState()))
    is working perfectly.Plzz Help me

    • @apoorvtiwari7612
      @apoorvtiwari7612 4 года назад +2

      You must be missing the default in switch statement or you might not have used return keyword in default.. I was also facing the same issue. It worked

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

      @@apoorvtiwari7612 It helped me, thanks!

  • @kalush81
    @kalush81 4 года назад +1

    Hi everyone. Can anyone explain how does calling unsubscribe() actually tells redux to unsubscribe?

    • @abhilashr838
      @abhilashr838 4 года назад

      I also have the same question

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

    Thank you Wishwas for your great videos, it helps me a lot to understand may things from JS or React. Just one point to this video around 6:15. To my understanding, that unsubscribe does not make much sense. You just assigned that to a const called unsubscribe. At the end of the day, it is just simply 'subscribe' method anyways and it does what is defined in the callback function once the state of the store is changed. So, in that case "console.log('Update state', ....)
    If you kept there just store.subscribe(() => console.log(....)), it would work exactly same as assigning that to cost unsubscribe and call this function. Or do I miss here anything? Thank you

    • @ganeshkg007
      @ganeshkg007 3 года назад +3

      Hi,
      Yes, even if we just omit the 'const unsubscribe' part, it will work fine, but why we are assigning that is - whatever returned from that assignment cancels that subscription. Means, if we call the returned function subscription is no longer valid. (If you add store.dispatch(buyCake()) after unsubscribe, you can see it no longer updates).
      Hope this helps.
      Ganesh.

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

      don't understand line no 32 why const unsubscribe u write ?????

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

    why not we just pass intial state as an parameter to createStore function
    const store = createStore(initState)

  • @arpankkr
    @arpankkr 4 года назад +1

    I am having this error please help
    Initial State { numofCakes: 10 }
    Updated State { numofCakes: 10, numOfCakes: NaN }

    • @sprajosh
      @sprajosh 4 года назад +2

      Typo in the key... use numOfCakes in both places

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

    After I ran the code my output is like
    10,9,9,9 why 🤔

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

      my output is like,
      Initial state : [object Object]
      update state : [object Object]
      update state : [object Object]
      update state : [object Object]

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

    How does it get initialState, it is passed as default param?

    • @mysterious_billionaire
      @mysterious_billionaire 8 месяцев назад

      it is passed as a parameter in this line..
      const reducer = (state = initialState, action) => {

  • @senangcoding4747
    @senangcoding4747 4 года назад

    thanks

  • @oabouassy
    @oabouassy 4 года назад

    guys, what's the name of this theme ? I love this colors

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

    amazing 👍👍👍👌👌

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

    request: can we have react-redux typescript series? hehehe

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

    Finally, I can speak English indian accents

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

    Can you share file slide ? Thank you.

  • @varchas-v8777
    @varchas-v8777 4 года назад

    What if we don't unsubscribe ?

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

    Are these videos still useful in 2022 or are they outdated ?

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

    Expected the root reducer to be a function. Instead, received: 'undefined'
    im getting above error

  • @saeedamin9793
    @saeedamin9793 4 года назад +1

    Thanks a lot for your amazing tutorial, I have seen several of them. There is just one thing that killing me is how you go back and forth through that bright screen and dark one. My eyes just died please make your presentation in dark mode. I usually watch them at night so dark mode would be perfect

  • @georgesamy73
    @georgesamy73 4 года назад

    Error: Actions must be plain objects. Use custom middleware for async actions.
    error what solve
    when node index

    • @seshugovinda2910
      @seshugovinda2910 4 года назад +2

      I am also faced this, just return object as below to avoid that error in BuyCake function . Cheers
      function BuyCake(){
      let sample = {
      type: BUY_CAKE,
      info:'First action '
      };
      return sample;

      }

    • @javid1326
      @javid1326 4 года назад

      you should use a middleware which is 'redux-thunk' for async actions.

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

    Please make videos on redux toolkit and rtk query

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

    it is throwing an error for me

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

    I don't understand one thing: how is unsubscribe an instance of subscribe?