createComputed method

  1. @override
LxAsyncComputed<T> createComputed(
  1. LevitRef ref,
  2. String ownerPath
)
override

Creates its scope-local LxReactive instance.

Implementation

@override
LxAsyncComputed<T> createComputed(LevitRef ref, String ownerPath) {
  return LxAsyncComputed<T>(
    () => _AutoLinkScope.runCaptured(
      () => _builder(ref),
      (captured, _) {
        for (final reactive in captured) {
          ref.autoDispose(reactive);
        }
      },
      ownerId: ownerPath,
    ),
    name: 'LevitState($ownerPath)',
  );
}