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