Skip to content
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

观察者 & 发布订阅 #86

Open
lkzwc opened this issue Nov 6, 2023 · 0 comments
Open

观察者 & 发布订阅 #86

lkzwc opened this issue Nov 6, 2023 · 0 comments

Comments

@lkzwc
Copy link
Owner

lkzwc commented Nov 6, 2023

观察者

观察者、被观察者

被观察者每次在自身改变之后都绑定式的触发对观察者的通知,是松耦合的

发布订阅

发布者、订阅者、发布订阅中心

  • 发布者只关心发布
  • 订阅者只关心订阅
  • 发布订阅负责维护关系
    做到了完全解耦
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant