isImmutable()

True if maybeImmutable is an Immutable Collection or Record.

isImmutable(maybeImmutable: unknown): boolean

Discussion

Note: Still returns true even if the collections is within a withMutations().

const { isImmutable, Map, List, Stack } = require('immutable');
isImmutable([]); // false
isImmutable({}); // false
isImmutable(Map()); // true
isImmutable(List()); // true
isImmutable(Stack()); // true
isImmutable(Map().asMutable()); // truerun it
This documentation is generated from immutable.d.ts. Pull requests and Issues welcome.

© 2014–present, Lee Byron and other contributors
Licensed under the 3-clause BSD License.
https://immutable-js.com/docs/v4.0.0/isImmutable()/