Describe Your Application Domain Using mobx-state-tree(MST) Models

Share this video with your friends

Send Tweet

In this lesson, we introduce the running example of this course, a wishlist app. We will take a look at the core of mobx-state-tree (MST), models. Models describe the shape of your state and perform type validation.

You will learn:

  • Defining models using types.Model
  • Instantiating models from JSON using Model.create
  • Primitive types: types.string & types.number
  • Type inference for primitive types
  • types.array
  • types.optional
  • Composing models into a model tree
  • Testing models using jest
Brian
~ 6 years ago

ERROR in src/app/about/about.component.spec.ts(3,34): error TS2307: Cannot find module '@angular/flex-layout'.

when i tried to initially run : yarn test

Brian
~ 6 years ago

to remedy, I did: npm install -g angular npm install angular-flex --save

then i got:

Error in config file! { Error: Cannot find module 'webpack/lib/dependencies/ContextElementDependency' at Function.Module._resolveFilename (module.js:527:15)

Michel Weststrateinstructor
~ 6 years ago

There is noabout.component.spec.ts or angular in this course...

Wix
~ 4 years ago

Unfortunately you didn't say a word about motivation — why on earth should you bother with MST in the first place. Any ideas may look good on toy tutorial example, but what is the case for MST in production?

Samuel Suther
~ 4 years ago

I'm new to mobX, so question for this Course: Do I need first get familiar with MobX (so this course is an add-on to mobx), or is this course also a good starting-point as first steps with mobx ?

Michel Weststrateinstructor
~ 4 years ago

It is not strictly necessary, but I would recommend to check it out to see how the wiring works and why the observer components react to the changes in MST