0.0.3 • Published 6 years ago

async-storage-tree v0.0.3

Weekly downloads
2
License
BSD-2-Clause
Repository
github
Last release
6 years ago

async-storage-tree

Use React's async-storage to create a tree of objects.

WIP - Use at your own peril!

install

npm install async-storage-tree

example

// TODO

api

  • createRoot(obj): Promise

Set obj as the root. Any existing items in asyncStorage will go untouched.

NOTE - If there is an existing root, its children will be orphaned! We recommend to .removeChild() first. (If no arguments are passde to removeChild(), the whole tree will be removed, including children of the root).

  • getRoot(): Promise[Object]

Gets root of tree, returns a Promise.

  • createChild(obj, parentId): Promise

Create obj as a new child of the leaf node with a given id. If no id is specified, will create child of the root node.

  • getChildren(id): Promise[List[Object]]

Get children of node with id. If no id specified, gets the children of the root node.

  • removeChild(id): Promise

Recursively delete nodes (i.e., id and all children).

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago