{"action":"created","issue":{"url":"https://api.github.com/repos/Level/deferred-leveldown/issues/9","labels_url":"https://api.github.com/repos/Level/deferred-leveldown/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/Level/deferred-leveldown/issues/9/comments","events_url":"https://api.github.com/repos/Level/deferred-leveldown/issues/9/events","html_url":"https://github.com/Level/deferred-leveldown/pull/9","id":81402602,"number":9,"title":"change api to leveldown api","user":{"login":"juliangruber","id":10247,"avatar_url":"https://avatars.githubusercontent.com/u/10247?v=3","gravatar_id":"","url":"https://api.github.com/users/juliangruber","html_url":"https://github.com/juliangruber","followers_url":"https://api.github.com/users/juliangruber/followers","following_url":"https://api.github.com/users/juliangruber/following{/other_user}","gists_url":"https://api.github.com/users/juliangruber/gists{/gist_id}","starred_url":"https://api.github.com/users/juliangruber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliangruber/subscriptions","organizations_url":"https://api.github.com/users/juliangruber/orgs","repos_url":"https://api.github.com/users/juliangruber/repos","events_url":"https://api.github.com/users/juliangruber/events{/privacy}","received_events_url":"https://api.github.com/users/juliangruber/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Level/deferred-leveldown/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-27T11:05:09Z","updated_at":"2015-05-27T12:11:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Level/deferred-leveldown/pulls/9","html_url":"https://github.com/Level/deferred-leveldown/pull/9","diff_url":"https://github.com/Level/deferred-leveldown/pull/9.diff","patch_url":"https://github.com/Level/deferred-leveldown/pull/9.patch"},"body":"this changes the api from\r\n\r\n```js\r\nvar db = DeferredLevelDOWN()\r\nvar down = leveldown('location')\r\ndown.open(function (err) {\r\n  db.setDb(down)\r\n})\r\n```\r\n\r\nto\r\n\r\n```js\r\nvar db = DeferredLevelDOWN(leveldown('location'))\r\ndb.open(function (err) {})\r\n```\r\n\r\nThis not only is simpler, but makes deferredleveldown have an api very similar to leveldown, which means in the near future we can do\r\n\r\n```js\r\nvar db = levelup(deferred(leveldown('location')))\r\n\r\n// or, with an already open leveldown:\r\nvar db = levelup(leveldown('location'))\r\n\r\n// or, with the level-lazy-open module:\r\nvar db = levelup(lazyOpen(leveldown('location')))\r\n```\r\n\r\nComposability!\r\n\r\nThis of course is a breaking change, but necessary for levelup@2\r\n\r\ncc @ralphtheninja @substack @mcollina @jcrugzz "},"comment":{"url":"https://api.github.com/repos/Level/deferred-leveldown/issues/comments/105886568","html_url":"https://github.com/Level/deferred-leveldown/pull/9#issuecomment-105886568","issue_url":"https://api.github.com/repos/Level/deferred-leveldown/issues/9","id":105886568,"user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T12:11:57Z","updated_at":"2015-05-27T12:11:57Z","body":"LGTM for me."}}