Skip to content

Commit

Permalink
chore: update mount docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 13, 2021
1 parent 6e75a61 commit 6a71c48
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- [`storage.getKeys(base?)`](#storagegetkeysbase)
- [`storage.clear(base?)`](#storageclearbase)
- [`storage.dispose()`](#storagedispose)
- [`storage.mount(mountpoint, driver, initialState?)`](#storagemountmountpoint-driver-initialstate)
- [`storage.mount(mountpoint, driver)`](#storagemountmountpoint-driver)
- [`storage.unmount(mountpoint, dispose = true)`](#storageunmountmountpoint-dispose--true)
- [`storage.watch(callback)`](#storagewatchcallback)
- [Utils](#utils)
Expand Down Expand Up @@ -139,16 +139,12 @@ Disposes all mounted storages to ensure there are no open-handles left. Call it
await storage.dispose()
```

### `storage.mount(mountpoint, driver, initialState?)`
### `storage.mount(mountpoint, driver)`

By default, everything is stored in memory. We can mount additional storage space in a Unix-like fashion.

When operating with a `key` that starts with mountpoint, instead of default storage, mounted driver will be called.

If `initialState` argument is provided, restores/hydrates state of mountpoint using `setItems`.

<!-- TODO: Explain mountpoint hiding -->

```js
import { createStorage } from 'unistorage'
import fsDriver from 'unistorage/drivers/fs'
Expand Down

0 comments on commit 6a71c48

Please sign in to comment.