repository_kit 0.1.2
repository_kit: ^0.1.2 copied to clipboard
A pure Dart toolkit for implementing clean, offline-first repositories by owning cache-vs-remote strategy decisions.
0.1.2 #
RKitCachePolicy.alwaysnow runsload()andfetch()in parallel. The first to complete determines the emission sequence: iffetch()wins,RKitSuccessis emitted directly andRKitCacheis never shown; ifload()wins,RKitCacheis emitted first, followed byRKitSuccesswhenfetch()completes. Total time toRKitSuccessis nowmax(load, fetch)instead ofload + fetch. All other policies are sequential and unchanged.
0.1.1 #
RKitRepositoryis now declared asabstract mixin class. It can be used withextends(unchanged from 0.1.0) or withwithwhen the consuming class already has a base class. No breaking changes.
0.1.0 #
Initial release.
RKitRepository<ResultType, RemoteType>— abstract base class with a two-shotwatch()stream engine.RKitState<T>— sealed state hierarchy with four subtypes:RKitLoading,RKitCache,RKitSuccess,RKitFailure.RKitCachePolicy— controls when the remote fetch is performed. Supportsalways,ifEmpty,never, andstaleIf(closure-based dynamic cache freshness check).RKitRetryPolicy— controls retry behaviour on request failure. Supportsnoneandexponentialbackoff.RKitException— exception type representing infrastructure failures, wrapping the underlying error and stacktrace.