thenWithContext<Q> method

FocusedLens<S, Q> thenWithContext<Q>(
  1. Lens<T, Q> lensMaker(
    1. S context
    )
)

Chain two lenses together.

Example:

 final bar = Bar(foos: [Foo(number: 101, name: "One"), Foo(number: 102, name: "Two")], driver: "One");

 final driversNumber =
     Bar$.foos.of(bar).thenWithContext((bar) => List$.where<Foo>((foo) => foo.name == bar.driver).then(Foo$.number));
 print(driversNumber.value);
 // 101

Implementation

FocusedLens<S, Q> thenWithContext<Q>(Lens<T, Q> Function(S context) lensMaker) =>
    FocusedLens<S, Q>._(_subject, _lens.thenWithContext(lensMaker));