Михаил Капелько hace 10 meses
padre
commit
19e4b7cd52
Se han modificado 3 ficheros con 31 adiciones y 1 borrados
  1. +15
    -0
      src/Bus.Receiver.swift
  2. +15
    -0
      src/Bus.Sender.swift
  3. +1
    -1
      src/VM.swift

+ 15
- 0
src/Bus.Receiver.swift Ver fichero

@@ -0,0 +1,15 @@
import Combine

public extension Bus {
final class Receiver<T> {
var subscriptions = [AnyCancellable]()

public init(
_ keys: Set<String>,
_ handler: @escaping ((String, T) -> Void),
opt: [Option] = [],
{
Bus.receive(keys, handler, opt: opt, sub: &subscriptions)
}
}
}

+ 15
- 0
src/Bus.Sender.swift Ver fichero

@@ -0,0 +1,15 @@
import Combine

public extension Bus {
final class Sender<T> {
var subscriptions = [AnyCancellable]()

public init(
_ key: String,
_ node: AnyPublisher<T, Never>,
opt: [Option] = []
) {
Bus.send(key, node, opt: opt, sub: &subscriptions)
}
}
}

+ 1
- 1
src/VM.swift Ver fichero

@@ -7,7 +7,7 @@ final class VM: ObservableObject {
var subscriptions = [AnyCancellable]()

init() {
Bus.send(
Bus.send(
MeetupId.K.meetupIdTextUI.rawValue,
$text
// Исключаем конфликты от UI и App путём игнорирования спама.


Cargando…
Cancelar
Guardar