Created
November 11, 2022 03:27
-
-
Save heyhey1028/04103c14e989800f7a5caeffc7a54da7 to your computer and use it in GitHub Desktop.
tips for manipulating streams in dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return CartOptionCategoryRepository.getAllCartOptionCategoryIDsStream( | |
userID: params.userID, | |
cartItemID: params.cartItemID, | |
).flatMap((cocIDs) { | |
return Rx.combineLatestList([ | |
for (final cocID in cocIDs) | |
CartOptionRepository.getAllCartOptionsStream( | |
userID: params.userID, | |
cartItemID: params.cartItemID, | |
cartOptionCategoryID: cocID, | |
).map( | |
(cos) => cos.map( | |
(co) => SelectedCartOption( | |
cartOptionCategoryID: cocID, | |
cartOption: co, | |
), | |
), | |
), //selectedCartOptionのstream | |
]).map((event) => event.expand((el) => el).toList()); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment