Skip to content

tadalabs/es6-complete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

es6-complete

es6-complete is an NPM for protecting objects at runtime in ES6

NPM version

notes

  • clone
  • npm install
  • npm run test

use

use it to protect things like static object properties...


import complete from 'es6-complete';

export default class SomeObject {}
SomeObject.foo = 'foo';

complete(SomeObject);

// the foo property is immutable

... or, instances

import complete from 'es6-complete';

export default class SomeClass {
    constructor() {
        this.foo = 'foo';
        complete(this);
    }
}

... or, complete something at just the right time.. .

import complete from 'es6-complete';

const handler = (thing) => {
    complete(thing);
    // send it somewhere
};

let a = 'this';
a = 'that';
a = 'the other thing';
handler(a);

About

an NPM for protecting objects at runtime in ES6

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published