Package: effect
Module: Resource
Re-runs this resource’s acquisition effect and updates the current value.
When to use
Use to force an existing Resource to reacquire its value at a
caller-controlled point.
Details
When acquisition succeeds, refreshing replaces the value stored in the resource’s scoped reference and releases resources associated with the previous value.
Gotchas
If acquisition fails, the returned effect fails and the previously stored
result is left as what get reads.
See
get for reading the current stored valuemanual for resources refreshed only by caller actionauto for schedule-driven automatic refreshesSignature
declare const refresh: <A, E>(self: Resource<A, E>) => Effect.Effect<void, E>
Since v2.0.0