Popsiclev2.1.0
GitHub ↗
Popsicle docs · 2.1.0

Parameterized State

Create independent Store instances keyed by runtime parameters.

Parameterized State

Use Popsicle.params when Store identity depends on a runtime argument.

final user = Popsicle.params(
  (scope, int id) => UserStore(
    id: id,
    repository: scope.get(userRepository),
  ),
);

Render one instance:

user(42).ui(
  (context, state, store) => UserProfile(state: state),
);

Each argument has an independent graph identity and cached state.