Skip to content
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

Merged
merged 4 commits into from
Nov 23, 2017
Merged

refactor: use async function and support koa@2 #13

merged 4 commits into from
Nov 23, 2017

Conversation

dead-horse
Copy link
Member

@dead-horse dead-horse commented Nov 22, 2017

closes #10

@codecov
Copy link

codecov bot commented Nov 22, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@d0d9a3d). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #13   +/-   ##
=========================================
  Coverage          ?   98.43%           
=========================================
  Files             ?        1           
  Lines             ?       64           
  Branches          ?        0           
=========================================
  Hits              ?       63           
  Misses            ?        1           
  Partials          ?        0
Impacted Files Coverage Δ
index.js 98.43% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0d9a3d...6c1db06. Read the comment docs.

@dead-horse
Copy link
Member Author

@fengmk2

README.md Outdated
@@ -34,22 +34,22 @@ $ npm install koa-roles
```js
var Roles = require('koa-roles');
var koa = require('koa');
Copy link
Member

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) {
Copy link
Member

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);
Copy link
Member

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.

@dead-horse
Copy link
Member Author

dead-horse commented Nov 23, 2017

Refactor

@dead-horse dead-horse mentioned this pull request Nov 23, 2017
29 tasks
@fengmk2 fengmk2 merged commit ddc662e into master Nov 23, 2017
@fengmk2 fengmk2 deleted the koa2 branch November 23, 2017 07:28
@fengmk2
Copy link
Member

fengmk2 commented Nov 23, 2017

2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Koa 2
2 participants