ResettableSelector

A resettable memoized selector.

Unlike the standard createSelector functions, this returns an object that allows you to reset the cache.

Example:

final selector = ResettableSelector.create1(
  getTodos,
  (todos) => todos.where((t) => !t.completed).toList(),
);

final result = selector.select(state); selector.resetCache(); // Clear the cached result

Properties

hashCode int
The hash code for this object.
no setterinherited

runtimeType Type

A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited

resetCache() → void

Resets the selector's cache.

select(S state) → R

Selects data from the state.

toString() String

A string representation of this object.
inherited

Operators

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

Static Methods

create1<S, T1, R>(Selector<S, T1> selector1, R combiner(T1)) ResettableSelector<S, R>
Creates a resettable selector with one input.

create2<S, T1, T2, R>(Selector<S, T1> selector1, Selector<S, T2> selector2, R combiner(T1, T2)) ResettableSelector<S, R>

Creates a resettable selector with two inputs.