overrideWithBuild method

Override overrideWithBuild(
  1. EntityChangeBinding build<T extends Object>(
    1. Ref ref,
    2. EntityChangeBridge<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(
  EntityChangeBinding Function<T extends Object>(
    Ref ref,
    EntityChangeBridge<T> notifier,
  )
  build,
) => $FamilyOverride(
  from: this,
  createElement: (pointer) {
    final provider = pointer.origin as EntityChangeBridgeProvider;
    return provider._captureGenerics(<T extends Object>() {
      provider as EntityChangeBridgeProvider<T>;
      return provider
          .$view(runNotifierBuildOverride: build<T>)
          .$createElement(pointer);
    });
  },
);