How to use BehaviorRelay as an alternate to Variable in RxSwift?

后端 未结 8 2034
无人共我
无人共我 2021-01-30 03:52

As of RxSwift4, Variable is moved to Deprecated.swift marking the possible deprecation of Variable in future. An alternate proposed to

8条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 04:35

    Have you considered simply creating a new array from the existing value on the relay, appending, then calling accept?

    myFilter.accept(myFilter.value + [newModel])
    

提交回复
热议问题