1.0.3 • Published 7 years ago

babel-plugin-immutable-const v1.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Babel plugin immutable const

Transform consted objects into immutable objects.

The object will be frozen. This will avoid future mutations on it. Update will simply be ignored and no errors will be thrown.

Installation

npm install --save-dev babel-plugin-immutable-const

Usage

Add the following line to your .babelrc file:

{
  "plugins": ["immutable-const"]
}

Example

const foo = { bar: true };

Will be transformed into:

const foo = Object.freeze({ bar: true });