MCPcopy
hub / github.com/mobxjs/mobx-state-tree / unprotect

Function unprotect

src/core/mst-operations.ts:298–305  ·  view source on GitHub ↗
(target: IAnyStateTreeNode)

Source from the content-addressed store, hash-verified

296 * ```
297 */
298export function unprotect(target: IAnyStateTreeNode): void {
299 // check all arguments
300 assertIsStateTreeNode(target, 1)
301
302 const node = getStateTreeNode(target)
303 if (!node.isRoot) throw new MstError("`unprotect` can only be invoked on root nodes")
304 node.isProtectionEnabled = false
305}
306
307/**
308 * Returns true if the object is in protected mode, @see protect

Callers 15

protect.test.tsFile · 0.90
enum.test.tsFile · 0.90
map.test.tsFile · 0.90
testPatchesFunction · 0.90
createStoreFunction · 0.90
afterCreateFunction · 0.90
hooks.test.tsFile · 0.90
afterCreateFunction · 0.90

Calls 2

assertIsStateTreeNodeFunction · 0.85
getStateTreeNodeFunction · 0.85

Tested by 6

testPatchesFunction · 0.72
createStoreFunction · 0.72
afterCreateFunction · 0.72
afterCreateFunction · 0.72
checkFunction · 0.72
testPatchesFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…