True if maybeImmutable
is an Immutable Collection or Record.
isImmutable(maybeImmutable: unknown): boolean
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