0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

docs: ChangeManager.Subscriber - lambdas

Documented that lambdas should not be used

Issue 16541
This commit is contained in:
David Allison 2024-06-06 08:42:48 +01:00 committed by lukstbit
parent 2e634d0cc4
commit e14aec6eec

View File

@ -44,7 +44,9 @@ import java.lang.ref.WeakReference
import java.util.concurrent.CopyOnWriteArrayList
object ChangeManager {
fun interface Subscriber {
// do not make this a 'fun interface' - lambdas may immediately be GCed
// due to the use of WeakReference
interface Subscriber {
/**
* Called after a backend method invoked via col.op() or col.opWithProgress()
* has modified the collection. Subscriber should inspect the changes, and update