Skip to content

Commit

Permalink
fix/#388 Observable Pattern 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
youz2me committed Sep 19, 2024
1 parent 73833a3 commit 8ff8bd2
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions KkuMulKum/Resource/ObservablePattern/ObservablePattern.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,13 @@ class ObservablePattern<T> {

func bind(_ listener: @escaping (T) -> Void) {
listeners.append(listener)

listener(value)
}

func bind<Object: AnyObject>(with object: Object, _ listener: @escaping (Object, T) -> Void) {
listeners.append { [weak object] value in
guard let object else { return }
listener(object, value)
}

listener(object, value)
}

func bindOnMain(_ listener: @escaping (T) -> Void) {
Expand All @@ -49,10 +45,6 @@ class ObservablePattern<T> {
listener(value)
}
}

DispatchQueue.main.async {
listener(self.value)
}
}

func bindOnMain<Object: AnyObject>(with object: Object, _ listener: @escaping (Object, T) -> Void) {
Expand All @@ -62,9 +54,5 @@ class ObservablePattern<T> {
listener(object, value)
}
}

DispatchQueue.main.async {
listener(object, self.value)
}
}
}

0 comments on commit 8ff8bd2

Please sign in to comment.