Skip to content

Commit

Permalink
regenned docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Aug 31, 2017
1 parent 9568fd3 commit 7034ca9
Showing 1 changed file with 8 additions and 28 deletions.
36 changes: 8 additions & 28 deletions API.md
Expand Up @@ -49,7 +49,6 @@ _This reference guide lists all methods exposed by MST. Contributions like lingu
- [recordPatches](#recordpatches)
- [resolveIdentifier](#resolveidentifier)
- [resolvePath](#resolvepath)
- [revertPatch](#revertpatch)
- [StoredReference](#storedreference)
- [tryResolve](#tryresolve)
- [Type](#type)
Expand Down Expand Up @@ -243,15 +242,15 @@ Removes a model element from the state tree, and mark it as end-of-life; the ele

**Parameters**

- `thing`
- `target`

## detach

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

**Parameters**

- `thing`
- `target`

## escapeJsonPath

Expand Down Expand Up @@ -289,7 +288,7 @@ see [Dependency injection](https://github.com/mobxjs/mobx-state-tree#dependency-

**Parameters**

- `thing` **IStateTreeNode**
- `target` **IStateTreeNode**

Returns **any**

Expand Down Expand Up @@ -394,7 +393,7 @@ is requesting it's last path and snapshot

**Parameters**

- `thing` **IStateTreeNode**
- `target` **IStateTreeNode**

Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**

Expand Down Expand Up @@ -456,7 +455,6 @@ Patches can be used to deep observe a model tree.

- `target` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the model instance from which to receive patches
- `callback`
- `includeOldValue`
- `boolean` **includeOldValue** if oldValue is included in the patches, they can be inverted. However patches will become much bigger and might not be suitable for efficient transport

Returns **IDisposer** function to remove the listener
Expand Down Expand Up @@ -531,8 +529,8 @@ Returns an recorder object with the following signature:
export interface IPatchRecorder {
// the recorded patches
patches: IJsonPatch[]
// the same set of recorded patches, but without undo information, making them smaller and compliant with json-patch spec
cleanPatches: IJSonPatch[]
// the inverse of the recorded patches
inversePatches: IJsonPatch[]
// stop recording patches
stop(target?: IStateTreeNode): any
// resume recording patches
Expand Down Expand Up @@ -572,23 +570,6 @@ Returns undefined if no value can be found.

Returns **any**

## revertPatch

The inverse function of apply patch.
Given a patch or set of patches, restores the target to the state before the patches where produced.
The inverse patch is computed, and all the patches are applied in reverse order, basically 'rewinding' the target,
so that conceptually the following holds for any set of patches:

`getSnapshot(x) === getSnapshot(revertPatch(applyPatches(x, patches), patches))`

Note: Reverting patches will generate a new set of patches as side effect of applying the patches.
Note: only patches that include `oldValue` information are suitable for reverting. Such patches can be generated by passing `true` as second argument when attaching an `onPatch` listener.

**Parameters**

- `target`
- `patch`

## StoredReference

## tryResolve
Expand Down Expand Up @@ -894,7 +875,7 @@ See also the [reference and identifiers](https://github.com/mobxjs/mobx-state-tr

**Parameters**

- `factory`
- `subType`

## types.refinement

Expand All @@ -904,7 +885,6 @@ See also the [reference and identifiers](https://github.com/mobxjs/mobx-state-tr

- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `type` **IType<T, T>**
- `predicate`

Returns **IType<T, T>**

Expand Down Expand Up @@ -980,5 +960,5 @@ Performs a depth first walk through a tree

**Parameters**

- `thing`
- `target`
- `processor`

0 comments on commit 7034ca9

Please sign in to comment.