-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extension functions for streams, add list of Transmissions to be …
…processed before the Test transmission
- Loading branch information
1 parent
ea7e295
commit ae7c4ca
Showing
4 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
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
11 changes: 11 additions & 0 deletions
11
transmission-test/src/main/java/com/yigitozgumus/transmissiontesting/StreamExt.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.yigitozgumus.transmissiontesting | ||
|
||
import com.trendyol.transmission.Transmission | ||
|
||
inline fun<reified T: Transmission.Data?> List<Transmission.Data>.lastInstanceOf(): T? { | ||
return this.filterIsInstance<T>().last() | ||
} | ||
|
||
inline fun<reified T: Transmission.Effect?> List<Transmission.Effect>.lastInstanceOf(): T? { | ||
return this.filterIsInstance<T>().last() | ||
} |
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
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