repository_kit 0.1.3
repository_kit: ^0.1.3 copied to clipboard
A pure Dart toolkit for implementing clean, offline-first repositories by owning cache-vs-remote strategy decisions.
0.1.3 #
- State Semantics Refinement:
RKitSuccessis now strictly emitted only when a remote fetch succeeds and its response is successfully persisted.RKitCacheis now emitted whenever cached data is available, acting as the terminal state for sequential strategies (ifEmpty,never,staleIf) when the cache policy decides to skip the remote fetch.
- Docs: Added mixin usage documentation and corrected emission tables in the README.
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.