OfflineMutationTypedLink constructor
OfflineMutationTypedLink({
- required Box<
Map< mutationQueueBox,String, dynamic> ?> - required Serializers serializers,
- required Cache cache,
- required StreamController<
OperationRequest> requestController, - LinkExceptionHandler? linkExceptionHandler,
OfflineMutationPlugin
can be used to maintain an Offline Mutation queue.
This plugin is intended to be an example for how offline mutations can be handled with ferry but doesn't address all edge cases.
Some limitations include:
- If the client shuts down during an inflight mutation (i.e. after a mutation has been sent to the server but before a response has been received), the mutation is assumed to have completed succesfully.
- When coming back online, all queued mutations are executed immediately in parallel, not serially. This could lead to unexpected behavior.
Implementation
OfflineMutationTypedLink({
required this.mutationQueueBox,
required this.serializers,
required this.cache,
required this.requestController,
this.linkExceptionHandler,
});