Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

Commit a1a120d

Browse files
authored
Merge pull request #30 from orbitdb/v1.5.0
v1.5.0
2 parents 783846a + 35a3917 commit a1a120d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "orbit-db-eventstore",
3-
"version": "1.5.0-rc3",
3+
"version": "1.5.0",
44
"description": "Eventlog for orbit-db",
55
"main": "src/EventStore.js",
66
"homepage": "https://github.com/orbitdb/orbit-db-eventstore",
@@ -21,7 +21,7 @@
2121
"author": "Haad",
2222
"license": "MIT",
2323
"dependencies": {
24-
"orbit-db-store": "next"
24+
"orbit-db-store": "~2.6.0"
2525
},
2626
"devDependencies": {
2727
"standard": "^12.0.1"

readme.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@ const IPFS = require('ipfs')
3434
const OrbitDB = require('orbit-db')
3535

3636
const ipfs = new IPFS()
37-
const orbitdb = new OrbitDB(ipfs)
37+
const orbitdb = await OrbitDB.createInstance(ipfs)
3838
```
3939

4040
Get a log database and add an entry to it:
4141

4242
```javascript
43-
const log = orbitdb.eventlog('haad.posts')
43+
const log = await orbitdb.eventlog('haad.posts')
4444
log.add({ name: 'hello world' })
4545
.then(() => {
46-
const items = log.iterator().collect()
47-
items.forEach((e) => console.log(e.name))
46+
const items = log.iterator().collect().map(e => e.payload.value)
47+
items.forEach(e => console.log(e.name))
4848
// "hello world"
4949
})
5050
```
5151

5252
Later, when the database contains data, load the history and query when ready:
5353

5454
```javascript
55-
const log = orbitdb.eventlog('haad.posts')
55+
const log = await orbitdb.eventlog('haad.posts')
5656
log.events.on('ready', () => {
57-
const items = log.iterator().collect()
58-
items.forEach((e) => console.log(e.name))
57+
const items = log.iterator().collect().map(e => e.payload.value)
58+
items.forEach(e => console.log(e.name))
5959
// "hello world"
6060
})
6161
```

0 commit comments

Comments
 (0)