本文整理匯總了TypeScript中@jonggrang/task.liftEff函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript liftEff函數的具體用法?TypeScript liftEff怎麽用?TypeScript liftEff使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了liftEff函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: shutdownServer
function shutdownServer(
state: ServerState
): T.Task<void> {
return T.sequencePar([
T.liftEff(null, state.connections, destroAllConnections),
closeServer(state.server)
]) as any;
}
示例2: commit
function commit(state: AppState<M, Q, S>): T.Task<AppState<M, Q, S>> {
return T.liftEff(null, state, commitRender)
.then(runSubs(state.interpret, app.subs(state.model))
.chain(tickInterpret =>
tickInterpret.tick()
.map(nextInterpret =>
({ snabbdom: state.snabbdom
, model: state.model
, interpret: nextInterpret
, needsRender: false})))
);
}
示例3: connectAndTrapSignal
function connectAndTrapSignal(
state: ServerState,
settings: Z.Settings
): T.Task<void> {
return T.sequencePar([
T.liftEff(null, state, registerRequestHandler),
listenConnection(state, settings)
]).chain(() => {
return T.race([
waitSignal('SIGINT'),
waitSignal('SIGTERM'),
settings.killToken == null ? T.never : takeAVar(settings.killToken)
]);
});
}
示例4: liftEff
export function status<A>(avar: AVar<A>): Task<Status<A>> {
return liftEff(null, () => avar.status);
}
示例5: killAVar
export function killAVar(error: Error, avar: AVar<any>): Task<void> {
return liftEff(null, error, avar, _killAVar);
}
示例6:
export function readRef<A>(ref: Ref<A>): T.Task<A> {
return T.liftEff(null, ref, _readRef);
}
示例7:
return T.toPromise(t.chain(b => {
return T.liftEff(null, () => {
assert.deepEqual(a, b);
});
}));
示例8: writeHead
writeHead(st: H.Status, headers: H.ResponseHeaders): T.Task<void> {
return T.liftEff(this.response, st, headers, this.response.writeHead);
}
示例9: defaultOnException
function defaultOnException(mreq: P.Maybe<IncomingMessage>, err: Error): T.Task<void> {
return T.liftEff(null, mreq, err, defaultOnExceptionEff);
}