(
options: number | {
readonly capacity: "unbounded"
readonly replay?: number | undefined
} | {
readonly capacity: number
readonly strategy?: "sliding" | "dropping" | "suspend" | undefined
readonly replay?: number | undefined
}
)
| 7006 | ) |
| 7007 | |
| 7008 | const pubsubFromOptions = <A, E>( |
| 7009 | options: number | { |
| 7010 | readonly capacity: "unbounded" |
| 7011 | readonly replay?: number | undefined |
| 7012 | } | { |
| 7013 | readonly capacity: number |
| 7014 | readonly strategy?: "sliding" | "dropping" | "suspend" | undefined |
| 7015 | readonly replay?: number | undefined |
| 7016 | } |
| 7017 | ): Effect.Effect<PubSub.PubSub<Take.Take<A, E>>> => { |
| 7018 | if (typeof options === "number") { |
| 7019 | return PubSub.bounded(options) |
| 7020 | } else if (options.capacity === "unbounded") { |
| 7021 | return PubSub.unbounded({ replay: options.replay }) |
| 7022 | } |
| 7023 | switch (options.strategy) { |
| 7024 | case "dropping": |
| 7025 | return PubSub.dropping(options) |
| 7026 | case "sliding": |
| 7027 | return PubSub.sliding(options) |
| 7028 | default: |
| 7029 | return PubSub.bounded(options) |
| 7030 | } |
| 7031 | } |
| 7032 | |
| 7033 | /** @internal */ |
| 7034 | export const toPubSub = dual< |
no outgoing calls
no test coverage detected
searching dependent graphs…