overrideWithBuild method

Override overrideWithBuild(
  1. EntityMutationState<T> build<T extends Object>(
    1. Ref ref,
    2. EntityMutations<T> notifier
    )
)

Overrides the build method of a notifier, allowing you to replace the default implementation with a custom one for testing or specific use cases.

This override affects only the build method of the notifier, leaving the rest of the provider's behavior unchanged. It is useful when you want to customize the notifier's initialization logic without altering other aspects of the provider.

Implementation

Override overrideWithBuild(
  EntityMutationState<T> Function<T extends Object>(
    Ref ref,
    EntityMutations<T> notifier,
  )
  build,
) => $FamilyOverride(
  from: this,
  createElement: (pointer) {
    final provider = pointer.origin as EntityMutationsProvider;
    return provider._captureGenerics(<T extends Object>() {
      provider as EntityMutationsProvider<T>;
      return provider
          .$view(runNotifierBuildOverride: build<T>)
          .$createElement(pointer);
    });
  },
);