docs(set): edit weakmap

This commit is contained in:
ruanyf
2017-04-26 23:03:25 +08:00
parent 66b16e3b4a
commit e2867f1956
2 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -320,7 +320,7 @@ var Thunk = function(fn){
};
// ES6版本
var Thunk = function(fn) {
const Thunk = function(fn) {
return function (...args) {
return function (callback) {
return fn.call(this, ...args, callback);
@@ -342,10 +342,9 @@ readFileThunk(fileA)(callback);
function f(a, cb) {
cb(a);
}
let ft = Thunk(f);
const ft = Thunk(f);
let log = console.log.bind(console);
ft(1)(log) // 1
ft(1)(console.log) // 1
```
### Thunkify 模块