forked from
jollywhoppers.com/witchsky.app
fork
Configure Feed
Select the types of activity you want to include in your feed.
Bluesky app fork with some witchin' additions 馃挮
fork
Configure Feed
Select the types of activity you want to include in your feed.
1export function cancelable<A, T>(
2 f: (args: A) => Promise<T>,
3 signal: AbortSignal,
4) {
5 return (args: A) => {
6 return new Promise<T>((resolve, reject) => {
7 signal.addEventListener('abort', () => {
8 reject(new AbortError())
9 })
10 f(args).then(resolve, reject)
11 })
12 }
13}
14
15export class AbortError extends Error {
16 constructor() {
17 super('Aborted')
18 this.name = 'AbortError'
19 }
20}