juliangruber/level-secondary — pull request #4 by maxogden (2014-12-20 22:20:32+00:00)
Title: decouple from level-sublevel

I wanted to use this with level-spaces, to minimize the amount of global state across levelup instances (e.g. from the level-spaces readme: `level-spaces is aimed at basic use-cases and does not introduce any versioning problems by modifying the original LevelUP instance`)

this proposes an api change to make it possible to pass in your own subdb. now the only thing required is that the subdb has been level-hooks-ified, so usage could be something like:

```js
// NOTE secondary currently requires a level-hooks-ified instance as 1st arg
var usersDb = levelSpace(db, 'users')
hooks(usersDb) // TODO find non-mutating alternative to level-hooks
var byGithubId = Secondary(usersDb, levelSpace(usersDb, 'githubHandle'), 'handle')
```