Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
() =>
pipe(
T.race(breakerError, waitFiberSlot(fiberSlot)),
T.foldExit(
c => pushBreaker.cause(c), // if we get a latchError forward it through to downstream
constant(pushQueue.offer(none)) // otherwise we are done, so lets forward that
)
),
next =>
const decodedQueryResultTE = queryResultTE.chain(result =>
fromEither(
fromPredicate(isNonEmptyResult, constant(expectedAtLeastOneErrorFailure(query, context)))(
result,
)
.map(({ rows }) => transformer(rows))
.mapLeft(identity)
.chain(rows =>
t
.array(type)
.decode(rows)
.mapLeft(makeRowValidationError(type, rows, context)),
)
.map(rows => new NonEmptyArray(rows[0], rows.slice(1))),
),
);
return s => this.modify(constant(a))(s)
}
export function as(stream: Stream, b: B): Stream {
return map_(stream, constant(b));
}
export function concat(
stream1: Stream,
stream2: Stream
): Stream {
return concatL(stream1, constant(stream2));
}
export function as(fa: ManagedR, b: B): ManagedR {
return map(fa, constant(b));
}
() =>
connection
.query(SQL`COMMIT;`, context)
.run()
.then(eitherToPromise)
.then(constant(a)),
e => (isDriverQueryError(e) ? e : makeUnhandledConnectionError(e)),
case BookmarksActionTypes.SetBookmarkDeleteId:
return bookmarkDeleteId.set(a.payload);
case BookmarksActionTypes.SetStagedBookmarksGroupEditId:
return stagedBookmarksGroupEditId.set(a.payload);
case BookmarksActionTypes.SetStagedBookmarksGroupBookmarkEditId:
return stagedBookmarksGroupBookmarkEditId.set(a.payload);
case BookmarksActionTypes.UpdateStagedBookmarksGroupBookmark: {
const [newGrpId, newBm] = a.payload;
const eqGrp = flow(grpId.get, eqNumber(newGrpId));
const eqBm = flow(bmId.get, eqNumber(newBm.id));
return stagedBookmarksGroups.modify(mapByPredicate(
grpBms.modify(mapByPredicate(constant(newBm))(eqBm))
)(eqGrp));
}
case BookmarksActionTypes.DeleteStagedBookmarksGroupBookmark: {
const [newGrpId, newBmId] = a.payload;
const eqGrp = flow(grpId.get, eqNumber(newGrpId));
const eqBm = flow(bmId.get, eqNumber(newBmId));
return stagedBookmarksGroups.modify(mapByPredicate(
grpBms.modify(A.filter(not(eqBm))),
)(eqGrp));
}
case BookmarksActionTypes.SetDeleteBookmarkModalDisplay:
return displayDeleteBookmarkModal.set(a.payload);
const onLoadPreComms = (): ThunkAC => (dispatch) => {
getActiveTheme()
.then(EO.getOrElse(constant(Theme.Light)))
.then((theme) => {
dispatch(setActiveTheme(theme));
});
};