Skip to content

Commit

Permalink
fix scope
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Dec 23, 2023
1 parent 5e3d9f6 commit 1d3a339
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-countries-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect-app/infra": patch
---

fix scope
2 changes: 1 addition & 1 deletion packages/infra/_src/services/RequestContextContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const live = Effect
ref.getAndUpdate(f).tap((rc) => Effect.annotateCurrentSpan(rc.spanAttributes)),
start: (a: RequestContext) => ref.set(a) > a.restoreStoreId
}))
.toLayer(RequestContextContainer)
.toLayerScoped(RequestContextContainer)

/** @tsplus static RequestContext.Ops Tag */
export const RCTag = Tag<RequestContext>()
Expand Down
2 changes: 1 addition & 1 deletion packages/infra/_src/services/Store/ContextMapContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const live = Effect
.sync(() => makeContextMap())
.andThen(FiberRef.make<ContextMap>)
.map((ref) => new ContextMapContainer({ get: ref.get, start: ContextMap.Make.flatMap((_) => ref.set(_)) }))
.toLayer(ContextMapContainer)
.toLayerScoped(ContextMapContainer)

/** @tsplus static ContextMap.Ops Tag */
export const RCTag = Tag<ContextMap>()

0 comments on commit 1d3a339

Please sign in to comment.