git ssb

0+

wanderer🌟 / js-dfinity-radix-tree



Commit 679937360074d0e31e59880b76fbfa01da58efd3

rebuild docs

Signed-off-by: wanderer <mjbecze@gmail.com>
wanderer committed on 12/2/2017, 6:34:40 AM
Parent: f9661bdacce6cf38306dfab66da860f6e2e9c4be

Files changed

docs/index.mdchanged
docs/index.mdView
@@ -2,19 +2,21 @@
22
33 ### Table of Contents
44
55 - [constructor](#constructor)
6 +- [getSubTree](#getsubtree)
67 - [get](#get)
78 - [set](#set)
89 - [delete](#delete)
10 +- [done](#done)
911 - [flush](#flush)
1012 - [emptyTreeState](#emptytreestate)
1113 - [ArrayConstructor](#arrayconstructor)
1214 - [getMerkleLink](#getmerklelink)
1315
1416 ## constructor
1517
16-[index.js:18-26](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L18-L26 "Source code on GitHub")
18 +[index.js:17-26](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L17-L26 "Source code on GitHub")
1719
1820 **Parameters**
1921
2022 - `opts`
@@ -22,15 +24,26 @@
2224 - `opts.db` {object} a level db instance alternitly `opts.graph` can be used
2325 - `opts.graph` {object} an instance of [ipld-graph-builder](https://github.com/ipld/js-ipld-graph-builder) alternitvly `opts.dag` can be used
2426 - `opts.dag` {object} an instance if [ipfs.dag](https://github.com/ipfs/js-ipfs#dag). If there is no `opts.graph` this will be used to create a new graph instance.
2527
28 +## getSubTree
29 +
30 +[index.js:33-38](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L33-L38 "Source code on GitHub")
31 +
32 +creates a new instance of RadixTree that is the subTree of the given key
33 +
34 +**Parameters**
35 +
36 +- `key` **any**
37 +- `decode`
38 +
39 +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** resolve to the new instance of RadixTree
40 +
2641 ## get
2742
28-[index.js:133-142](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L133-L142 "Source code on GitHub")
43 +[index.js:45-50](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L45-L50 "Source code on GitHub")
2944
30-gets a value given a key. The promise resolves with an object containing
31-`node` the node in the merkle tree and `value` the value of the that the
32-node contains
45 +gets a value given a key
3346
3447 **Parameters**
3548
3649 - `key` **any**
@@ -39,9 +52,9 @@
3952 Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
4053
4154 ## set
4255
43-[index.js:149-151](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L149-L151 "Source code on GitHub")
56 +[index.js:113-116](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L113-L116 "Source code on GitHub")
4457
4558 stores a value at a given key
4659
4760 **Parameters**
@@ -52,9 +65,9 @@
5265 Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
5366
5467 ## delete
5568
56-[index.js:198-200](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L198-L200 "Source code on GitHub")
69 +[index.js:161-164](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L161-L164 "Source code on GitHub")
5770
5871 deletes a value at a given key
5972
6073 **Parameters**
@@ -62,33 +75,41 @@
6275 - `key` **any**
6376
6477 Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
6578
79 +## done
80 +
81 +[index.js:223-229](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L223-L229 "Source code on GitHub")
82 +
83 +returns a promise that resolve when the tree is done with all of its writes
84 +
85 +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
86 +
6687 ## flush
6788
68-[index.js:260-263](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L260-L263 "Source code on GitHub")
89 +[index.js:245-248](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L245-L248 "Source code on GitHub")
6990
7091 creates a merkle root for the current tree and stores the data perstantly
7192
7293 Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
7394
7495 ## emptyTreeState
7596
76-[index.js:49-51](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L49-L51 "Source code on GitHub")
97 +[index.js:278-280](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L278-L280 "Source code on GitHub")
7798
7899 returns the state of an empty tree
79100
80101 ## ArrayConstructor
81102
82-[index.js:57-59](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L57-L59 "Source code on GitHub")
103 +[index.js:286-288](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L286-L288 "Source code on GitHub")
83104
84105 returns an Uint1Array constructir which is used to repersent keys
85106
86107 Returns **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
87108
88109 ## getMerkleLink
89110
90-[index.js:66-68](https://github.com/dfinity/js-dfinity-radix-tree/blob/ca8952130fa954fc6fad3847bdd48dd40fc3228f/index.js#L66-L68 "Source code on GitHub")
111 +[index.js:295-297](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L295-L297 "Source code on GitHub")
91112
92113 returns a merkle link for some given data
93114
94115 **Parameters**

Built with git-ssb-web