```fun RecyclerView.Adapter<*>.ifHasFlag(flags: In...
# announcements
u
Copy code
fun RecyclerView.Adapter<*>.ifHasFlag(flags: Int, flag: Int, body: () -> Unit): Boolean {
    return if (flags.hasFlag(flag)) {  <--- replace flags with this
        body()
        true
    } else {
        false
    }
}
so the callsite within any Adapter looks like
Copy code
fun onBindHolder(..., payload) {
     payload.ifHasFlag(FLAG) {
         ...
     }
}
i
u
thx