Interceptor
Base class for intercepting the call chain from Kakao to Espresso.
Interceptors can be provided through Kakao runtime, different Screens as well as KViews.
Interceptors are stacked during the runtime for any Kakao-Espresso check
and perform
operations. The stack ordering is following: KView interceptor -> Screen interceptors -> Kakao interceptor.
Any of the interceptors in the chain can break the chain call by setting isOverride
to true in onCheck, onPerform or onAll interception functions during the configuration. Doing this will not only prevent underlying interceptors from being invoked, but prevents Kakao from executing the operation. In that case, responsibility for actually making Espresso call lies on developer.
For each operation the interceptor invocation cycle will be as follows:
// For check operation
onAll?.invoke()
onCheck?.invoke()
// For perform operation
onAll?.invoke()
onPerform?.invoke()