enabling decorators for mobx

mobx is really great for state management (I prefer it over redux)

it is even handier if you can use decorators; to do that its probably easier to use babel 6 (due to some of the issues described here).

using npm install –save you should end add the following packages:

 "babel": "^6.5.2",
 "babel-core": "^6.18.0",
 "babel-loader": "^6.2.7",
 "babel-plugin-transform-decorators-legacy": "^1.3.4",
 "babel-preset-es2015": "^6.18.0",
 "babel-preset-react": "^6.16.0",
 "babel-preset-stage-1": "^6.16.0",

and then just add the following to .babelrc

  "presets": [
  "plugins": ["transform-decorators-legacy"]








// —- ESNext syntax with decorators —-

ES6 decorators babel

Enabling decorators (optional) Decorators are currently a stage-2 ESNext feature. How to enable them

About Neil Rubens

see http://ActiveIntelligence.org
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *