triggerAction

abstract fun triggerAction(cohortId: String, callback: Method<Boolean>): TriggerAction

Notifies the given callback when the cohort result updates.

Return

TriggerAction representing the active subscription.

Samples

samples.permutive.TriggersProviderKt.triggerAction

Parameters

callback

The method to be called with the query result Boolean each time it changes. Called once on initialization with the current result.


abstract fun <T : Any> triggerAction(queryId: Int, callback: Method<T>): TriggerAction

Deprecated

Non-boolean results are no longer supported, only callbacks with boolean result types will be called

Replace with

triggerAction(cohortId: String, callback: Method<Boolean>)

Notifies the specified callback with the query state.

Return

a TriggerAction representing the active subscription.

Samples

samples.permutive.TriggersProviderKt.triggerActionBoolean

Parameters

callback

The method to be called each time the query state changes. Will be called once upon creation, and each time a change occurs. The callback may not be on the calling thread.