本文整理匯總了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);
}