LoginSignup
1
0

More than 5 years have passed since last update.

【RxSwift】flatMapでunwrapしたい

Last updated at Posted at 2018-08-15

やりかた

flatMap.swift
flatMap { Observable.from(optional: $0) }

Observable.from(optional:)の説明

Converts a optional to an observable sequence.

解説

↓このissueの下の方に書いてありました
https://github.com/ReactiveX/RxSwift/issues/450#issuecomment-314296626

ストリームで流れてくる値をUnwrapしたい!って時は上記のように書けば良いらしい。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0