LikeOfflineSyncInterceptor constructor
LikeOfflineSyncInterceptor({
- required Dio dio,
- required Box queueBox,
- LikeAuthConfig? authConfig,
- LikeReplayCodec codec = const DefaultLikeReplayCodec(),
- bool autoSchedule = false,
- LikeSessionScope currentSession()?,
- FutureOr<
void> notifyRefresh(- String path
Implementation
LikeOfflineSyncInterceptor({
required this.dio,
required this._queueBox,
this.authConfig,
this.codec = const DefaultLikeReplayCodec(),
this.autoSchedule = false,
LikeSessionScope Function()? currentSession,
FutureOr<void> Function(String path)? notifyRefresh,
}) : currentSession = currentSession ?? (() => const LikeSessionScope()),
_notifyRefresh =
notifyRefresh ?? ((path) => LikeClient().notifyRefresh(path)) {
if (autoSchedule) {
_queueSubscription = _queueBox.watch().listen((_) {
_publish();
_scheduleNext();
});
_scheduleNext();
}
}