Add in-memory relay

This commit is contained in:
Jon Staab
2024-04-21 16:01:32 -07:00
parent f738682fb3
commit eb5ffe873e
14 changed files with 246 additions and 27 deletions
+13 -5
View File
@@ -1,10 +1,10 @@
import type {Filter} from '@coracle.social/util'
export enum FeedType {
Difference = "\\",
Intersection = "",
SymmetricDifference = "Δ",
Union = "",
Difference = "difference",
Intersection = "intersection",
SymmetricDifference = "symdiff",
Union = "union",
Filter = "filter",
Relay = "relay",
List = "list",
@@ -15,7 +15,6 @@ export enum FeedType {
export enum Scope {
Followers = "followers",
Follows = "follows",
Global = "global",
Network = "network",
Self = "self",
}
@@ -60,6 +59,15 @@ export const listFeed = (...addresses: string[]) => [FeedType.List, ...addresses
export const lolFeed = (...addresses: string[]) => [FeedType.LOL, ...addresses] as Feed
export const dvmFeed = (...requests: DVMItem[]) => [FeedType.DVM, ...requests] as Feed
export const hasSubFeeds = ([type]: Feed) =>
[
FeedType.Union,
FeedType.Intersection,
FeedType.Difference,
FeedType.SymmetricDifference,
FeedType.Relay,
].includes(type)
export const getSubFeeds = ([type, ...feed]: Feed): Feed[] => {
switch (type) {
case FeedType.Relay: