QueryFamily<T, Arg> class

A family of query reactons parameterized by an argument.

final userQuery = reactonQueryFamily<User, String>(
  queryFn: (ctx) => api.fetchUser(ctx.arg),
  name: 'user',
);

// Usage:
final user = store.get(userQuery('user-123'));

Constructors

QueryFamily({required Future<T> queryFn(QueryContext<Arg>), QueryConfig config = const QueryConfig(), String? name})

Properties

cachedArgs Iterable<Arg>
All currently cached arguments.
no setter
config QueryConfig
final
hashCode int
The hash code for this object.
no setterinherited
queryFn Future<T> Function(QueryContext<Arg>)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(Arg arg) QueryReacton<T>
Get or create a query reacton for the given argument.
clear() → void
Clear all cached queries.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(Arg arg) → void
Remove a cached query.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited