Skip to content

Instantly share code, notes, and snippets.

View asarazan's full-sized avatar

Aaron Sarazan asarazan

View GitHub Profile

Flow Wrapper Function (Live Templates)

flow wrap

Creates a wrapper for a function returning Flow accepting no arguments

fun $NAME$(onEach: ($TYPE$) -> Unit, onCompletion: (Throwable?) -> Unit): Cancellable =
    $NAME$().collect(onEach, onCompletion)