Skip to content

Commit

Permalink
Add async/await DEMO to READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
iwillwen committed Jul 13, 2015
1 parent 1ebd3c0 commit 5faffa3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ Anymore else? How about `MULTI`?
console.log(results); //=> [ [ 1 ], [ 2 ], [ 3 ] ]
});

SWEET! Let's run to **Harmony**(ES2015)!

async _ => {
var userId = await min.incr('users:id:seq')
await min.hmset(`user:${userId}`, {
name: 'Will Wen Gunn',
sign: 'iwillwen',
homepage: 'http://lifemap.in'
})
await min.sadd(`user:${userId}:msgs`, 'Welcome')
}

Support multiple databases:

var Min = min.fork();
Expand Down
12 changes: 12 additions & 0 deletions README_zhcn.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ MinDB 提供一个标准的存储接口(`Store Interface`)和 **Redis** 风格
console.log(results); //=> [ [ 1 ], [ 2 ], [ 3 ] ]
});

ES2015的时代已经到来,你还在等什么?

async _ => {
var userId = await min.incr('users:id:seq')
await min.hmset(`user:${userId}`, {
name: 'Will Wen Gunn',
sign: 'iwillwen',
homepage: 'http://lifemap.in'
})
await min.sadd(`user:${userId}:msgs`, 'Welcome')
}

MinDB 也支持多数据库:

var Min = min.fork();
Expand Down

0 comments on commit 5faffa3

Please # to comment.