Hyperlinkv0.8.0-beta.28

Resource

Resource.getconsteffect/Resource.ts:154
<A, E>(self: Resource<A, E>): Effect.Effect<A, E>

Retrieves the current value stored in this resource.

When to use

Use to read the value currently cached by a Resource.

Gotchas

If the resource currently stores a failed acquisition result, the returned effect fails with the stored error.

gettersrefresh
export const get = <A, E>(self: Resource<A, E>): Effect.Effect<A, E> =>
  Effect.flatMap(ScopedRef.get(self.scopedRef), identity)