session-cache
Advanced tools
Comparing version 0.1.2 to 0.1.3
18
index.js
@@ -66,2 +66,18 @@ /*! | ||
/** | ||
* Bind a function to the current Session context. | ||
* | ||
* ```js | ||
* function fn (options, next) { | ||
* next(); | ||
* } | ||
* session.bind(fn); | ||
* ``` | ||
* | ||
* @param {Function} `fn` Function to bind. | ||
* @api public | ||
*/ | ||
exports.bind = session.bind.bind(session); | ||
/** | ||
* Bind an EventEmitter or Stream to the current Session context. | ||
@@ -71,3 +87,3 @@ * | ||
* var stream = through.obj(); | ||
* sessin.bindEmitter(stream); | ||
* session.bindEmitter(stream); | ||
* ``` | ||
@@ -74,0 +90,0 @@ * |
{ | ||
"name": "session-cache", | ||
"description": "Session storage for tasks.", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"homepage": "https://github.com/doowb/session-cache", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -38,4 +38,17 @@ # session-cache [![NPM version](https://badge.fury.io/js/session-cache.svg)](http://badge.fury.io/js/session-cache) | ||
### [.bindEmitter](index.js#L77) | ||
### [.bind](index.js#L79) | ||
Bind a function to the current Session context. | ||
* `fn` **{Function}**: Function to bind. | ||
```js | ||
function fn (options, next) { | ||
next(); | ||
} | ||
session.bind(fn); | ||
``` | ||
### [.bindEmitter](index.js#L93) | ||
Bind an EventEmitter or Stream to the current Session context. | ||
@@ -47,6 +60,6 @@ | ||
var stream = through.obj(); | ||
sessin.bindEmitter(stream); | ||
session.bindEmitter(stream); | ||
``` | ||
### [.set](index.js#L88) | ||
### [.set](index.js#L104) | ||
@@ -59,3 +72,3 @@ * `key` **{String}** | ||
### [.get](index.js#L103) | ||
### [.get](index.js#L119) | ||
@@ -62,0 +75,0 @@ * `key` **{String}** |
8348
128
94