本文整理匯總了TypeScript中src/schedule.read函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript read函數的具體用法?TypeScript read怎麽用?TypeScript read使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了read函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: write
write(function () {
operations.push('write1');
read(function () {
operations.push('read3');
resolve();
});
});
示例2: read
read(function () {
operations.push('read1');
read(function () {
operations.push('read2');
resolve();
});
});
示例3: Promise
new Promise(function (resolve, reject) {
read(function () {
operations.push('read1');
read(function () {
operations.push('read2');
resolve();
});
});
}),
示例4: require
import registerSuite = require('intern!object');
import assert = require('intern/chai!assert');
import { read, write} from 'src/schedule';
import Promise from 'dojo-core/Promise';
registerSuite({
read() {
const dfd = this.async();
read(dfd.callback(function () {}));
},
write() {
const dfd = this.async();
write(dfd.callback(function () {}));
},
destroy: {
read() {
let didRead = false;
const handle = read(function () {
didRead = true;
});
handle.destroy();
const dfd = this.async();
setTimeout(dfd.callback(function () {
assert.isFalse(didRead);
}), 100);
},
write() {