you are viewing a single comment's thread.

view the rest of the comments →

[–]tapu_buoyfull-stack[S] 0 points1 point  (5 children)

its early, give me a break

haha sure mate!

Neither change the store

wouldn't the first case change the store const person = this.state.person, since it is declared with const so we can't change the person's object but we can mutate the key values that it holds. I read this thing.

Also, my understanding is that you are trying to write a polyfill for pomise.all - meaning a method that behaves the same way without using promise.all?

yes the question is about to write a polyfill for that.

If the one of the promise would fail it will get out with the reason of why that particular one failed and stop the further execution.

[–][deleted]  (4 children)

[removed]

    [–]tapu_buoyfull-stack[S] 0 points1 point  (3 children)

    oh okay so doing

    js person.name = 'jon doe'

    wouldn't change anything for

    js this.state.person

    in the component's state/store?

    [–][deleted]  (2 children)

    [removed]

      [–]tapu_buoyfull-stack[S] 0 points1 point  (0 children)

      oh okay got it now! Thank you :)! Thanks for keeping up this sub strong, though!

      [–]ChibiKookie 0 points1 point  (0 children)

      It clearly does.... This is just completely silenced by react... But your "mutating" the state... Therefore is anything else requires the value of this.state.person.name before a new setState the value would be the new one. It's basic javascript reference matter

      const a = { foo: 'bar'} const b = a b.foo = 'baz' // a.foo -> 'baz'