Use observable objects, arrays, and maps to store state in MobX

Share this video with your friends

Send Tweet

So far we have used the observable decorator extensively. Let's take a closer look on what it does and see how the extendObservable and observable functions can be used to create observable objects, arrays and maps.

Parker
Parker
~ 5 years ago

It seems like getting the Kelvin and Fahrenheit reversed is going to be an ongoing thing... Is there any way to fix this? It is pretty distracting to the otherwise great lesson.

Michel Weststrate
Michel Weststrateinstructor
~ 5 years ago

Saddly not without re-recording all the videos. It is a really stupid mistake (I'm only used to Celsius myself ;-)) so I hope it is not too much in the way!

Philipp Blume
Philipp Blume
~ 2 years ago

const temps = observable ([]); temps.push(new Temperature())

But.. how can you push to a const?

Edward Nnadi
Edward Nnadi
~ 2 years ago

But.. how can you push to a const?

const doesnot make an object to which points 'temps' immutable, you just cannot reassign and redeclare the 'temps' variable again