本文整理汇总了TypeScript中@jonggrang/ref.writeRef函数的典型用法代码示例。如果您正苦于以下问题:TypeScript writeRef函数的具体用法?TypeScript writeRef怎么用?TypeScript writeRef使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了writeRef函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loop
.chain(q2 => {
if (q2.length === 0) {
return R.writeRef(machine, st)
.then(R.writeRef(queue, []));
}
return loop(st);
});
示例2: co
return co(function* () {
yield takeAVar(needsRunning);
const a: A = yield maybe(set.task, identity, applyMaybe(modify, ma)) as Task<A>;
yield writeRef(currRef, right(a));
yield putAVar(responseVar, a);
yield delay(set.delay);
const responseVar_: AVar<A> = yield newEmptyAVar;
yield writeRef(currRef, left(responseVar_));
return loop(responseVar_, just(a));
});
示例3: check
function check(merge: (_: W) => W, s: State<W>): [State<W>, T.Task<void>] {
if (s.tag === StateType.NOREAPER) {
throw new Error('unexpected NoReaper (2)');
}
let wl = merge(s.workload);
return settings.isNull(wl)
? [{ tag: StateType.NOREAPER }, R.writeRef(tidRef, void 0)]
: [{ tag: StateType.WORKLOAD, workload: wl }, reaper(settings, stateRef, tidRef) ];
}
示例4: writeRef
.chain(sbs => {
let nkey = sbs.fresh.toString();
return writeRef(subsRef, S.assign({}, sbs, {
fresh: sbs.fresh + 1,
sbs: S.assign({}, sbs.cbs, {
[nkey]: cb
})
})).map(v => remove(nkey));
});
示例5:
.chain(step => {
return R.writeRef(machine, step).then(T.pure(inst));
});
示例6: inactive
function inactive(ms: MutableStatus): T.Task<void> {
return RV.writeRef(ms, Status.INACTIVE);
}
示例7: refresh
function refresh(ms: MutableStatus): T.Task<void> {
return RV.writeRef(ms, Status.ACTIVE);
}