koa-session
Advanced tools
Comparing version 4.7.0 to 4.7.1
4.7.1 / 2018-01-11 | ||
================== | ||
**fixes** | ||
* [[`5683102`](http://github.com/koajs/session/commit/5683102687c48ba11521d8b249126de13e7c0d8b)] - fix: emit event in next tick (dead-horse <<dead_horse@qq.com>>) | ||
4.7.0 / 2018-01-09 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -157,3 +157,3 @@ 'use strict'; | ||
if (!value) { | ||
this.app.emit('session:missed', { key, value, ctx }); | ||
this.emit('missed', { key, value, ctx }); | ||
return false; | ||
@@ -164,3 +164,3 @@ } | ||
debug('expired session'); | ||
this.app.emit('session:expired', { key, value, ctx }); | ||
this.emit('expired', { key, value, ctx }); | ||
return false; | ||
@@ -173,3 +173,3 @@ } | ||
debug('invalid session'); | ||
this.app.emit('session:invalid', { key, value, ctx }); | ||
this.emit('invalid', { key, value, ctx }); | ||
return false; | ||
@@ -181,2 +181,13 @@ } | ||
/** | ||
* @param {String} event event name | ||
* @param {Object} data event data | ||
* @api private | ||
*/ | ||
emit(event, data) { | ||
setImmediate(() => { | ||
this.app.emit(`session:${event}`, data); | ||
}); | ||
} | ||
/** | ||
* create a new session and attach to ctx.sess | ||
@@ -183,0 +194,0 @@ * |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/session", | ||
"version": "4.7.0", | ||
"version": "4.7.1", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "koa", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23644
500