MutatedEffect
A Composable function to trigger side effects when a Mutation is successfully processed.
By using this function, you can receive the result of a successful Mutation via block. This is particularly useful when working with MutationObject.mutateAsync.
Parameters
Type of the return value from the mutation.
Type of the key to identify whether the Mutation has already been handled.
The MutationObject whose result will be observed.
A function to calculate a key to identify whether the Mutation has already been handled. The key is compared upon the next success.
A Saver to persist and restore the last consumed key.
A callback to handle the result of the Mutation. This is called only when the key differs from the previous one.
A Composable function to trigger side effects when a Mutation is successfully processed.
This function uses MutationObject.mutatedCount as the key. If you need to use a different key, use MutatedEffect with the keySelector
parameter.
NOTE: If Mutation optimization is enabled, you must explicitly specify a keySelector
. This is because MutationObject.mutatedCount is omitted during optimization and will always be 0
.
Parameters
Type of the return value from the mutation.
The MutationObject whose result will be observed.