Skip to content

Commit

Permalink
Published version 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed May 8, 2017
1 parent daca22a commit 74ba5f4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
56 changes: 28 additions & 28 deletions API.md
@@ -1,6 +1,6 @@
# maybeMST

[lib/core/mst-node.js:28-40](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-node.js#L28-L40 "Source code on GitHub")
[lib/core/mst-node.js:28-40](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-node.js#L28-L40 "Source code on GitHub")

Tries to convert a value to a TreeNode. If possible or already done,
the first callback is invoked, otherwise the second.
Expand All @@ -14,19 +14,19 @@ The result of this function is the return value of the callbacks, or the origina

# ComplexType

[lib/types/complex-types/complex-type.js:18-53](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/types/complex-types/complex-type.js#L18-L53 "Source code on GitHub")
[lib/types/complex-types/complex-type.js:18-53](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/types/complex-types/complex-type.js#L18-L53 "Source code on GitHub")

A complex type produces a MST node (Node in the state tree)

# get

[lib/core/mst-node-administration.js:51-55](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-node-administration.js#L51-L55 "Source code on GitHub")
[lib/core/mst-node-administration.js:51-55](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-node-administration.js#L51-L55 "Source code on GitHub")

Returnes (escaped) path representation as string

# pseudoAction

[lib/core/mst-node-administration.js:316-321](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-node-administration.js#L316-L321 "Source code on GitHub")
[lib/core/mst-node-administration.js:316-321](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-node-administration.js#L316-L321 "Source code on GitHub")

Pseudo action is an action that is not named, does not trigger middleware but does unlock the tree.
Used for applying (initial) snapshots and patches
Expand All @@ -37,29 +37,29 @@ Used for applying (initial) snapshots and patches

# map

[lib/types/index.js:24-26](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/types/index.js#L24-L26 "Source code on GitHub")
[lib/types/index.js:24-26](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/types/index.js#L24-L26 "Source code on GitHub")

**Parameters**

- `subFactory` **\[ModelFactory]** (optional, default `primitiveFactory`)

# array

[lib/types/index.js:34-36](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/types/index.js#L34-L36 "Source code on GitHub")
[lib/types/index.js:34-36](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/types/index.js#L34-L36 "Source code on GitHub")

**Parameters**

- `subFactory` **\[ModelFactory]** (optional, default `primitiveFactory`)

# props

[lib/types/complex-types/object.js:45-45](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/types/complex-types/object.js#L45-L45 "Source code on GitHub")
[lib/types/complex-types/object.js:45-45](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/types/complex-types/object.js#L45-L45 "Source code on GitHub")

Parsed description of all properties

# addMiddleware

[lib/core/mst-operations.js:50-55](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L50-L55 "Source code on GitHub")
[lib/core/mst-operations.js:50-55](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L50-L55 "Source code on GitHub")

TODO: update docs
Registers middleware on a model instance that is invoked whenever one of it's actions is called, or an action on one of it's children.
Expand Down Expand Up @@ -103,7 +103,7 @@ Returns **IDisposer** function to remove the middleware

# onPatch

[lib/core/mst-operations.js:67-69](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L67-L69 "Source code on GitHub")
[lib/core/mst-operations.js:67-69](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L67-L69 "Source code on GitHub")

Registers a function that will be invoked for each that as made to the provided model instance, or any of it's children.
See 'patches' for more details. onPatch events are emitted immediately and will not await the end of a transaction.
Expand All @@ -118,7 +118,7 @@ Returns **IDisposer** function to remove the listener

# applyPatch

[lib/core/mst-operations.js:83-85](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L83-L85 "Source code on GitHub")
[lib/core/mst-operations.js:83-85](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L83-L85 "Source code on GitHub")

Applies a JSON-patch to the given model instance or bails out if the patch couldn't be applied

Expand All @@ -129,7 +129,7 @@ Applies a JSON-patch to the given model instance or bails out if the patch could

# applyPatches

[lib/core/mst-operations.js:94-99](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L94-L99 "Source code on GitHub")
[lib/core/mst-operations.js:94-99](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L94-L99 "Source code on GitHub")

Applies a number of JSON patches in a single MobX transaction

Expand All @@ -140,7 +140,7 @@ Applies a number of JSON patches in a single MobX transaction

# applyActions

[lib/core/mst-operations.js:125-129](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L125-L129 "Source code on GitHub")
[lib/core/mst-operations.js:125-129](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L125-L129 "Source code on GitHub")

Applies a series of actions in a single MobX transaction.

Expand All @@ -154,7 +154,7 @@ Does not return any value

# protect

[lib/core/mst-operations.js:163-165](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L163-L165 "Source code on GitHub")
[lib/core/mst-operations.js:163-165](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L163-L165 "Source code on GitHub")

By default it is allowed to both directly modify a model or through an action.
However, in some cases you want to guarantee that the state tree is only modified through actions.
Expand Down Expand Up @@ -184,7 +184,7 @@ todo.toggle() // OK

# isProtected

[lib/core/mst-operations.js:174-176](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L174-L176 "Source code on GitHub")
[lib/core/mst-operations.js:174-176](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L174-L176 "Source code on GitHub")

Returns true if the object is in protected mode, @see protect

Expand All @@ -194,7 +194,7 @@ Returns true if the object is in protected mode, @see protect

# applySnapshot

[lib/core/mst-operations.js:186-188](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L186-L188 "Source code on GitHub")
[lib/core/mst-operations.js:186-188](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L186-L188 "Source code on GitHub")

Applies a snapshot to a given model instances. Patch and snapshot listeners will be invoked as usual.

Expand All @@ -205,7 +205,7 @@ Applies a snapshot to a given model instances. Patch and snapshot listeners will

# hasParent

[lib/core/mst-operations.js:202-212](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L202-L212 "Source code on GitHub")
[lib/core/mst-operations.js:202-212](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L202-L212 "Source code on GitHub")

Given a model instance, returns `true` if the object has a parent, that is, is part of another object, map or array

Expand All @@ -218,7 +218,7 @@ Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe

# getPath

[lib/core/mst-operations.js:238-240](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L238-L240 "Source code on GitHub")
[lib/core/mst-operations.js:238-240](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L238-L240 "Source code on GitHub")

Returns the path of the given object in the model tree

Expand All @@ -230,7 +230,7 @@ Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

# getPathParts

[lib/core/mst-operations.js:249-251](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L249-L251 "Source code on GitHub")
[lib/core/mst-operations.js:249-251](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L249-L251 "Source code on GitHub")

Returns the path of the given object as unescaped string array

Expand All @@ -242,7 +242,7 @@ Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere

# isRoot

[lib/core/mst-operations.js:260-262](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L260-L262 "Source code on GitHub")
[lib/core/mst-operations.js:260-262](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L260-L262 "Source code on GitHub")

Returns true if the given object is the root of a model tree

Expand All @@ -254,7 +254,7 @@ Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe

# resolve

[lib/core/mst-operations.js:272-276](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L272-L276 "Source code on GitHub")
[lib/core/mst-operations.js:272-276](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L272-L276 "Source code on GitHub")

Resolves a path relatively to a given object.

Expand All @@ -267,7 +267,7 @@ Returns **Any**

# tryResolve

[lib/core/mst-operations.js:286-291](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L286-L291 "Source code on GitHub")
[lib/core/mst-operations.js:286-291](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L286-L291 "Source code on GitHub")

**Parameters**

Expand All @@ -278,7 +278,7 @@ Returns **Any**

# clone

[lib/core/mst-operations.js:305-314](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L305-L314 "Source code on GitHub")
[lib/core/mst-operations.js:305-314](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L305-L314 "Source code on GitHub")

**Parameters**

Expand All @@ -289,7 +289,7 @@ Returns **T**

# detach

[lib/core/mst-operations.js:319-322](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L319-L322 "Source code on GitHub")
[lib/core/mst-operations.js:319-322](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L319-L322 "Source code on GitHub")

Removes a model element from the state tree, and let it live on as a new state tree

Expand All @@ -299,7 +299,7 @@ Removes a model element from the state tree, and let it live on as a new state t

# destroy

[lib/core/mst-operations.js:327-333](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L327-L333 "Source code on GitHub")
[lib/core/mst-operations.js:327-333](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L327-L333 "Source code on GitHub")

Removes a model element from the state tree, and mark it as end-of-life; the element should not be used anymore

Expand All @@ -309,7 +309,7 @@ Removes a model element from the state tree, and mark it as end-of-life; the ele

# walk

[lib/core/mst-operations.js:353-361](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/mst-operations.js#L353-L361 "Source code on GitHub")
[lib/core/mst-operations.js:353-361](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/mst-operations.js#L353-L361 "Source code on GitHub")

Performs a depth first walk through a tree

Expand All @@ -320,7 +320,7 @@ Performs a depth first walk through a tree

# applyAction

[lib/core/action.js:107-114](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/action.js#L107-L114 "Source code on GitHub")
[lib/core/action.js:107-114](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/action.js#L107-L114 "Source code on GitHub")

Dispatches an Action on a model instance. All middlewares will be triggered.
Returns the value of the last actoin
Expand All @@ -333,7 +333,7 @@ Returns the value of the last actoin

# escapeJsonPath

[lib/core/json-patch.js:9-11](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/json-patch.js#L9-L11 "Source code on GitHub")
[lib/core/json-patch.js:9-11](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/json-patch.js#L9-L11 "Source code on GitHub")

escape slashes and backslashes
<http://tools.ietf.org/html/rfc6901>
Expand All @@ -344,7 +344,7 @@ escape slashes and backslashes

# unescapeJsonPath

[lib/core/json-patch.js:16-18](https://github.com/mweststrate/mobx-state-tree/blob/d3bb104e830f2bd18f0879716605aff8f4d7e269/lib/core/json-patch.js#L16-L18 "Source code on GitHub")
[lib/core/json-patch.js:16-18](https://github.com/mweststrate/mobx-state-tree/blob/daca22a164cea51037b1be571b96d98ab5ff3988/lib/core/json-patch.js#L16-L18 "Source code on GitHub")

unescape slashes and backslashes

Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "mobx-state-tree",
"version": "0.5.0",
"version": "0.5.1",
"description": "Opinionated, transactional, MobX powered state container",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -64,4 +64,4 @@
"test-lib/src/**/*.js"
]
}
}
}

0 comments on commit 74ba5f4

Please sign in to comment.