From 2458316efe9e31b7c725ff3f51aef56450bfbaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Thu, 16 Jul 2026 22:05:59 +0200 Subject: [PATCH] Add helpers --- packages/effect-lens-next/src/Lens.ts | 5 +++++ packages/effect-lens-next/src/View.ts | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/effect-lens-next/src/Lens.ts b/packages/effect-lens-next/src/Lens.ts index 784c5d6..3dddf59 100644 --- a/packages/effect-lens-next/src/Lens.ts +++ b/packages/effect-lens-next/src/Lens.ts @@ -912,6 +912,11 @@ export const focusOption: { */ export const get = (self: Lens): Effect.Effect => self.get +/** + * Returns the stream of changes from a `Lens`. + */ +export const changes = (self: Lens): Stream.Stream => self.changes + /** * Atomically modifies the value of a `Lens` and returns a computed result. */ diff --git a/packages/effect-lens-next/src/View.ts b/packages/effect-lens-next/src/View.ts index a32e8a7..c6871db 100644 --- a/packages/effect-lens-next/src/View.ts +++ b/packages/effect-lens-next/src/View.ts @@ -244,3 +244,14 @@ export const focusChunkSize = ( export const focusIterableSize = , E, R>( self: View, ): View => map(self, Iterable.size) + + +/** + * Reads the current value from a `View`. + */ +export const get = (self: View): Effect.Effect => self.get + +/** + * Returns the stream of changes from a `View`. + */ +export const changes = (self: View): Stream.Stream => self.changes