本文整理汇总了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() {