-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor] ObservablePattern 다중 구독 구현하기 #387
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
private var listener: ((T) -> Void)? | ||
typealias Listener = (T) -> Void | ||
|
||
private var listeners: [Listener] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
캬...
private func notifyListeners(_ value: T) { | ||
for listener in listeners { | ||
listener(value) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
더 간편해졌군요!! 감사합니닷 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이제 사용시에 이전과 동일하게 사용하는거지만 다중구독이 되는걸까요?
네, 그렇습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 생각을 못했었네요 짱입니다👍🏻
🔗 연결된 이슈
📄 작업 내용
💻 주요 코드 설명
Observable Pattern의 다중 구독