GithubHelp home page GithubHelp logo

Comments (2)

beeth0ven avatar beeth0ven commented on May 22, 2024

抱歉 @kkkelicheng ,让你久等了,由于我最近有点忙,还没来得及回复你。

你提的问题非常具有代表性,我需要整理一下思维。

在下周之前回答你提出的问题。

谢谢你的关注!

from rxswift-chinese-documentation.

beeth0ven avatar beeth0ven commented on May 22, 2024

怎么理解Observable的附加作用就是subscribe函数?
虽然文档解释了是类似于Observeable.create({})。
然后文章直接给出了,这里的闭包{ (observer) -> Disposable in ... }可以看作是 subscribe 函数。
。。。

小弟不才,还请大佬指导一下。
public func subscribe<Observer>(_ observer: Observer) -> RxSwift.Disposable
subscribe函数哪里来的附加作用。

你好,public func subscribe<Observer>(_ observer: Observer) -> RxSwift.Disposable 是一个抽象的 interface.
而在具体的使用场景中, func subscribe 的内部实现是确定的,而这些内部实现往往会包含诸如:

  • 网络请求
  • 点击事件,用户输入
  • 数据库操作
  • ...

类似的的附加作用 。

如果你有任何疑问,还请给我留言。
谢谢!

from rxswift-chinese-documentation.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.