typed_links
library
Classes
AddTypenameTypedLink
Adds __typename
to each node of the operation.
BinaryReader
The BinaryReader is used to bring data back from the binary format on the
disk.
BinaryWriter
The BinaryWriter is used to encode data to the binary format.
Box <E >
Boxes contain all of your data. In the browser, each box has its own
IndexedDB database. On all other platforms, each Box is stored in a
separate file in the Hive home directory.
BoxBase <E >
Boxes contain all of your data. In the browser, each box has its own
IndexedDB database. On all other platforms, each Box is stored in a
seperate file in the Hive home directory.
BoxCollection
BoxEvent
A event representing a change in a box.
Cache
CacheProxy
Provides an interface for interacting with the Cache from within
UpdateCacheHandler s.
CacheTypedLink
A terminating link that fetches the operation from the Cache, mapping the
result to an OperationResponse .
CollectionBox <V >
represents a Box being part of a BoxCollection
ErrorTypedLink
Catches Exception s in the link chain and converts them into data.
FetchPolicy
FetchPolicyTypedLink
A terminating link that resolves an operation from the link
or the
cache based on the OperationRequest.fetchPolicy , possibly caching the
response
FieldFunctionOptions
FieldPolicy <TExisting , TIncoming , TReadResult >
FragmentRequest <TData , TVars >
GqlTypedLink
A terminating link which defers execution to the provided gql_link
,
mapping the result to an OperationResponse .
HiveAesCipher
Default encryption algorithm. Uses AES256 CBC with PKCS7 padding.
HiveCipher
Abstract cipher can be implemented to customize encryption.
HiveCollection <E extends HiveObjectMixin >
List containing HiveObjectMixin s.
HiveField
Annotate all fields you want to persist with HiveField .
HiveInterface
The main API interface of Hive. Available through the Hive
constant.
HiveList <E extends HiveObjectMixin >
Allows defining references to other HiveObjectMixin s.
HiveObject
HiveType
Annotate classes with HiveType to generate a TypeAdapter
.
JsonOperationRequest
A OperationRequest that parses the response into a Map<String, dynamic>
this is useful for when you don't have a generated class for the operation
or as an escape hatch for when you want to parse the response yourself.
LazyBox <E >
LazyBox es don't keep the values in memory like normal boxes. Each time a
value is read, it is loaded from the backend.
Link
DocumentNode
-based GraphQL execution interface
MemoryStore
OfflineMutationTypedLink
Caches mutations in a hive
box when offline and re-runs them when
re-connected.
OperationRequest <TData , TVars >
OperationResponse <TData , TVars >
Encapsulates a GraphQL operation's response, with typed
input and responses, and errors.
OptimisticTypedLink
Returns the response stream from the next link in the chain, immediately
emitting a response with the optimistic data.
PassthroughLink
PassthroughTypedLink
RequestControllerTypedLink
Allows multiple requests to be made by adding requests to the
requestController .
RequestSerializer
JSON Request
serializer.
ResponseParser
JSON Response
parser
Store
TypeAdapter <T >
Type adapters can be implemented to support non primitive values.
TypedLink
A fully typed implementation of gql_link
TypePolicy
TypeRegistry
TypeRegistries contain the TypeAdapter s associated with a typeId.
UpdateCacheTypedLink
Runs any specified UpdateCacheHandler s with a CacheProxy when a
response is received from DataSource.Link or DataSource.Optimistic .
Mixins
HiveObjectMixin
Extend HiveObject
to add useful methods to the objects you want to store
in Hive
Functions
jsonMapEquals (Object ? a , Object ? b )
→ bool
compare two json-like objects for equality
parameters must be either null, num, bool, String or a List or Map of these types
this is an alternative too DeepCollectionEquality().equals, which is very slow and has
O(n^2) complexity
Typedefs
CompactionStrategy
= bool Function(int entries , int deletedEntries )
A function which decides when to compact a box.
FieldMergeFunction <TExisting , TIncoming >
= TExisting Function(TExisting existing , TIncoming incoming , FieldFunctionOptions options )
FieldReadFunction <TExisting , TReadResult >
= TReadResult Function(TExisting existing , FieldFunctionOptions options )
JsonEquals
= bool Function(Object ? a , Object ? b )
a function that compares two json-like maps for deep equality
more performant alternative to DeepCollectionEquality which has O(n^2) time complexity (where n is the level of nesting)
but also very slow on flat maps
KeyComparator
= int Function(dynamic key1 , dynamic key2 )
LinkExceptionHandler <TData , TVars >
= void Function(OperationResponse <TData , TVars > response , EventSink <OperationResponse <TData , TVars > > sink )
LinkFunction
= Stream <Response > Function(Request request , [NextLink ? forward ])
Link as a function
LinkRouter
= Link Function(Request request )
A function which returns a Link based on contents Request
NextLink
= Stream <Response > Function(Request request )
Type of the forward
function
NextTypedLink <TData , TVars >
= Stream <OperationResponse <TData , TVars > > Function(OperationRequest <TData , TVars > request )
Type of the forward
function
TypedLinkFunction
= Stream <OperationResponse <TData , TVars > > Function<TData , TVars >(OperationRequest <TData , TVars > request , [NextTypedLink <TData , TVars > ? forward ])
TypedLink as a function
TypedLinkRouter <TData , TVars >
= TypedLink Function(OperationRequest <TData , TVars > request )
A function which returns a TypedLink based on contents of request
UpdateCacheHandler <TData , TVars >
= void Function(CacheProxy proxy , OperationResponse <TData , TVars > response )
Updates the cache after receiving an OperationResponse .