-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use async function and support koa@2 #13
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
=========================================
Coverage ? 98.43%
=========================================
Files ? 1
Lines ? 64
Branches ? 0
=========================================
Hits ? 63
Misses ? 1
Partials ? 0
Continue to review full report at Codecov.
|
README.md
Outdated
@@ -34,22 +34,22 @@ $ npm install koa-roles | |||
```js | |||
var Roles = require('koa-roles'); | |||
var koa = require('koa'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Koa and new Koa()
README.md
Outdated
|
||
var user = new Roles({ | ||
failureHandler: function *(action) { | ||
async failureHandler(action, ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first argument should be ctx.
async failureHandler(ctx, action) {
index.js
Outdated
} | ||
const r = roles.failureHandler.call(ctx, action, ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roles.failureHandler(ctx, action)
should breaking change.
Refactor |
2.0.0 |
closes #10