Hyperlinkv0.8.0-beta.28

Hyperlink

Hyperlink.withStoreconstsrc/Store.ts:1593
<const C extends StoreContractValue>(contract: C): <
  T extends StoreScopeTag
>(
  tag: T
) => T & {
  readonly store: Effect.Effect<
    StoreHandleFromContract<C>,
    StoreScopeNotRegistered,
    Storage
  >
}

Attach a public store spec to a resource tag (pipe combinator).

Adds yield* Tag.store resolved through the Storage bridge.

spec fieldsStorage
Source src/Store.ts:159319 lines
export const withStore = <const C extends StoreContractValue>(
  contract: C,
): (<T extends StoreScopeTag>(tag: T) => T & {
  readonly store: Effect.Effect<
    StoreHandleFromContract<C>,
    StoreScopeNotRegistered,
    Storage
  >;
}) =>
  <T extends StoreScopeTag>(tag: T) =>
    Object.assign(tag, {
      store: resolve(tag.key, contract),
    }) as T & {
      readonly store: Effect.Effect<
        StoreHandleFromContract<C>,
        StoreScopeNotRegistered,
        Storage
      >;
    };