Skip to content

Commit

Permalink
Moved Observable's queue to subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrommcarrasco committed Jul 4, 2019
1 parent 4847d4c commit bd9b294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sucrose.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.swift_version = "5.0"
s.name = "Sucrose"
s.version = "3.6.0"
s.version = "4.0.0"
s.summary = "🍬 Everyday sugar"
s.description = "Collection of handy methods & objects"

Expand Down
6 changes: 3 additions & 3 deletions Sucrose/Objects/Observable.swift
Expand Up @@ -24,16 +24,16 @@ public final class Observable<T> {
private var observer: Observer?
private var queue: DispatchQueue?

public init(_ value: T, dispachOn queue: DispatchQueue? = nil) {
public init(_ value: T) {
self.value = value
self.queue = queue
}
}

extension Observable {

public func subscribe(_ observer: Observer?) {
public func subscribe(on queue: DispatchQueue? = nil, _ observer: Observer?) {
self.observer = observer
self.queue = queue
observer?(value)
}
}
Expand Down

0 comments on commit bd9b294

Please sign in to comment.