From 326894be1da2c68415026ab9bff1ce99d5c4fa9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Wed, 20 May 2026 03:20:05 +0200 Subject: [PATCH] Refactor --- packages/effect-lens/src/Lens.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/effect-lens/src/Lens.ts b/packages/effect-lens/src/Lens.ts index 5ef8119..b3384b7 100644 --- a/packages/effect-lens/src/Lens.ts +++ b/packages/effect-lens/src/Lens.ts @@ -57,13 +57,20 @@ extends Pipeable.Class() implements LensWithInternals { readonly [LensTypeId]: LensTypeId = LensTypeId readonly [LensWithInternalsTypeId]: LensWithInternalsTypeId = LensWithInternalsTypeId + readonly get: Effect.Effect + readonly changes: Stream.Stream + readonly update: (a: A) => Effect.Effect + readonly semaphore: Effect.Semaphore + constructor( - readonly get: Effect.Effect, - readonly changes: Stream.Stream, - readonly update: (a: A) => Effect.Effect, - readonly semaphore: Effect.Semaphore, + source: LensImpl.Source ) { super() + + this.get = source.get + this.changes = source.changes + this.update = source.update + this.semaphore = source.semaphore } modifyEffect( @@ -83,7 +90,7 @@ extends Pipeable.Class() implements LensWithInternals { */ export const make = ( source: LensImpl.Source -): Lens => new LensImpl(source.get, source.changes, source.update, source.semaphore) +): Lens => new LensImpl(source) export class LensLazyImpl