Skip to content

Commit

Permalink
update new blog
Browse files Browse the repository at this point in the history
  • Loading branch information
platojobs committed Apr 3, 2024
1 parent ca3420d commit cd78a3a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
39 changes: 37 additions & 2 deletions BACKUP/186_1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# [1](https://github.com/platojobs/SFLOG/issues/186)

总有一天,你会对著过去的伤痛微笑。你会感谢离开你的那个人,他配不上你的爱、你的好、你的痴心。他终究不是命定的那个人。幸好他不是。
`smaple` 除了订阅源obs以外,还可以监视另外一个notifier
之间有源就取最新的源发送
两次`noti`之间如果没有源的话,就不会发送

```swift

func sample(){
let disbag = DisposeBag()
let source1 = PublishSubject<Int>()
let noti1 = PublishSubject<String>()
source1.sample(noti1)
.subscribe(onNext: {
print($0)
},onCompleted: {
print("1===completed")
}).disposed(by: disbag)

source1.onNext(1) //1
noti1.onNext("A")
source1.onNext(2) //2
noti1.onNext("B")
noti1.onNext("C")
source1.onNext(3)
source1.onNext(4)
noti1.onNext("D")
source1.onNext(5)
noti1.onCompleted()
/*
1
2
4
5
*/
}


```

—— 张小娴 ​​​​
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,17 @@ My personal blog using issues and GitHub Actions (哈哈)
## MobileDevelopment
- [Widget 的两种类型](https://github.com/platojobs/SFLOG/issues/195)--2022-05-09
- [swift-enum](https://github.com/platojobs/SFLOG/issues/194)--2022-05-08
- [1](https://github.com/platojobs/SFLOG/issues/186)--2022-04-28
- [Quartz 2D绘图中常见的函数及其功能](https://github.com/platojobs/SFLOG/issues/117)--2022-02-15
- [swift跳出语句](https://github.com/platojobs/SFLOG/issues/89)--2022-01-17
- [随手记](https://github.com/platojobs/SFLOG/issues/84)--2022-01-08
- [57:swiftc常用命令](https://github.com/platojobs/SFLOG/issues/61)--2021-11-30
- [55:BlockOperation](https://github.com/platojobs/SFLOG/issues/59)--2021-10-25
- [54: swift的函数](https://github.com/platojobs/SFLOG/issues/58)--2021-10-21
- [53: swift中枚举的内存布局](https://github.com/platojobs/SFLOG/issues/57)--2021-10-21
- [33云:swift的Mirror的内部实现,修改代码实现探索](https://github.com/platojobs/SFLOG/issues/33)--2021-08-27
<details><summary>显示更多</summary>

- [33云:swift的Mirror的内部实现,修改代码实现探索](https://github.com/platojobs/SFLOG/issues/33)--2021-08-27
- [19云:iOS 13.0以后presentViewController](https://github.com/platojobs/SFLOG/issues/19)--2021-08-07
</details>

Expand Down

0 comments on commit cd78a3a

Please # to comment.