Skip to content

Commit

Permalink
Merge branch 'master' into add-getIn
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Feldman authored Feb 12, 2017
2 parents 0993089 + 5068f09 commit b5231ca
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 19 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ not actually be immutable!

## Add-ons

seamless-immutable is tightly focused on the mechanics of turning existing JavaScript data structurs into immutable variants.
seamless-immutable is tightly focused on the mechanics of turning existing JavaScript data structures into immutable variants.
Additional packages are available to build on this capability and enable additional programming models:

|Library|Description|
Expand Down Expand Up @@ -184,6 +184,20 @@ mutableArray // ["hello", "world", "!!!"]

Returns a mutable copy of the array. For a deeply mutable copy, in which any instances of `Immutable` contained in nested data structures within the array have been converted back to mutable data structures, call `Immutable.asMutable(obj, {deep: true})` instead.

### isImmutable
```javascript
var array = Immutable(["hello", "world"]);
var mutableArray = ["hello", "world"];

Immutable.isImmutable(array)
// returns true

Immutable.isImmutable(mutableArray)
// returns false
```

Returns whether an object is immutable or not.

## Immutable Object

Like a regular Object, but immutable! You can construct these by passing an
Expand Down
11 changes: 5 additions & 6 deletions seamless-immutable.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,12 @@ function immutableInit(config) {
]);

function ImmutableError(message) {
var err = new Error(message);
// TODO: Consider `Object.setPrototypeOf(err, ImmutableError);`
err.__proto__ = ImmutableError;

return err;
this.name = 'MyError';
this.message = message;
this.stack = (new Error()).stack;
}
ImmutableError.prototype = Error.prototype;
ImmutableError.prototype = new Error;
ImmutableError.prototype.constructor = Error;

function makeImmutable(obj, bannedMethods) {
// Tag it so we can quickly tell it's immutable later.
Expand Down
2 changes: 1 addition & 1 deletion seamless-immutable.development.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b5231ca

Please sign in to comment.