@dxos/echo
    Preparing search index...

    Variable loadConst

    load: <T>(
        ref: Ref<T>,
        options?: LoadOptions,
    ) => Effect.Effect<T, EntityNotFoundError, never> = ...

    Loads an object reference. A deleted target reads as absent unless { deleted: 'include' } asks for it.

    The options parameter means this cannot be passed point-free where the caller supplies a second argument — Effect.forEach(refs, (ref) => load(ref)), not Effect.forEach(refs, load), since the iteratee index would land on options.

    Catching not found error:

    yield* load(ref).pipe(Effect.catchTag('EntityNotFoundError', () => Effect.succeed(undefined)));
    

    Type declaration

      • <T>(
            ref: Ref<T>,
            options?: LoadOptions,
        ): Effect.Effect<T, EntityNotFoundError, never>
      • Type Parameters

        • T

        Parameters

        • ref: Ref<T>
        • Optionaloptions: LoadOptions

        Returns Effect.Effect<T, EntityNotFoundError, never>

    Async; resolves immediately for a loaded target, otherwise loads from disk or the network.