Add Effect v4 support, Fast Refresh tooling, and revamped docs #56
@@ -44,10 +44,9 @@ export class ScopeRegistryServiceImpl implements ScopeRegistryService {
|
||||
options: ScopeRegistryService.RegisterOptions,
|
||||
): Effect.Effect<ScopeRegistryService.Entry> {
|
||||
return Effect.gen({ self: this }, function*() {
|
||||
const now = yield* DateTime.now
|
||||
const entry = Equal.byReference({
|
||||
scope: yield* Scope.make(options.finalizerExecutionStrategy),
|
||||
expiresAt: Option.some(DateTime.addDuration(now, options.finalizerExecutionDebounce)),
|
||||
expiresAt: Option.some(DateTime.addDuration(yield* DateTime.now, options.finalizerExecutionDebounce)),
|
||||
finalizerExecutionDebounce: options.finalizerExecutionDebounce,
|
||||
})
|
||||
|
||||
@@ -115,12 +114,12 @@ export class ScopeRegistryServiceImpl implements ScopeRegistryService {
|
||||
get closeExpired(): Effect.Effect<void> {
|
||||
return Effect.flatMap(DateTime.now, now => SubscriptionRef.modify(
|
||||
this.ref,
|
||||
entries => HashMap.reduce(
|
||||
entries,
|
||||
HashMap.reduce(
|
||||
[
|
||||
Chunk.empty<ScopeRegistryService.Entry>(),
|
||||
HashMap.empty<ScopeRegistryService.Key, ScopeRegistryService.Entry>(),
|
||||
] as const,
|
||||
|
||||
([expired, remaining], entry, key) => Option.exists(
|
||||
entry.expiresAt,
|
||||
expiresAt => DateTime.isLessThanOrEqualTo(expiresAt, now),
|
||||
|
||||
Reference in New Issue
Block a user