Михаил Капелько 10 månader sedan
förälder
incheckning
2df3868836
3 ändrade filer med 9 tillägg och 9 borttagningar
  1. +4
    -4
      Modules/BusX/Bus/src/Bus.Debounce.swift
  2. +4
    -4
      Modules/BusX/Bus/src/Bus.Delay.swift
  3. +1
    -1
      Modules/BusX/Bus/src/Bus.Sync.swift

Modules/MeetupIdX/src/MeetupId.Debounce.swift → Modules/BusX/Bus/src/Bus.Debounce.swift Visa fil

@@ -1,23 +1,23 @@
import BusX
import Combine

extension MeetupId {
public extension Bus {
final class Debounce<Src, Dst> {
let v = PassthroughSubject<Src, Never>()
var subscriptions = [AnyCancellable]()

init(
_ sec: Double,
_ handler: @escaping ((Src) -> Dst?),
_ sec: Double,
_ src: String,
_ dst: String
) {
// Вход.
Bus.receiveSync(
[src],
{ [weak self] _, v in self?.v.send(v) },
&subscriptions
)
// Выход.
Bus.sendSync(
dst,
v

Modules/MeetupIdX/src/MeetupId.Delay.swift → Modules/BusX/Bus/src/Bus.Delay.swift Visa fil

@@ -1,23 +1,23 @@
import BusX
import Combine

extension MeetupId {
public extension Bus {
final class Delay<Src, Dst> {
let v = PassthroughSubject<Src, Never>()
var subscriptions = [AnyCancellable]()

init(
_ sec: Double,
_ handler: @escaping ((Src) -> Dst?),
_ sec: Double,
_ src: String,
_ dst: String
) {
// Вход.
Bus.receiveSync(
[src],
{ [weak self] _, v in self?.v.send(v) },
&subscriptions
)
// Выход.
Bus.sendSync(
dst,
v

+ 1
- 1
Modules/BusX/Bus/src/Bus.Sync.swift Visa fil

@@ -5,7 +5,7 @@ public extension Bus {
let v = PassthroughSubject<Src, Never>()
var subscriptions = [AnyCancellable]()

public init(
init(
_ handler: @escaping ((Src) -> Dst?),
_ src: String,
_ dst: String


Laddar…
Avbryt
Spara