effect-tree - v1.0.36
    Preparing search index...

    Function getFocus

    • Get the current focus of the zipper.

      Type Parameters

      • A

        Underlying tree type.

      Parameters

      Returns Tree<A>

      The focus of the zipper.

      import {Zipper, from, of} from 'effect-tree'
      import {pipe} from 'effect'

      const tree = from(1, of(2))

      const zipper = pipe(
      tree,
      Zipper.fromTree,
      Zipper.head,
      )

      expect(Zipper.getFocus(zipper)).toEqual(of(2))