/** * Locally installs a supervisor and an effect that succeeds with all the * children that have been forked in the returned effect. * * @tsplus static effect/core/io/Effect.Ops withChildren */ export function withChildren( get: (children: Effect>>) => Effect ): Effect { return Supervisor.track.flatMap((supervisor) => get( supervisor.value.flatMap((children) => Effect.descriptor.map((descriptor) => // Filter out the fiber id of whoever is calling `withChildren` children.filter((fiber) => !(fiber.id == descriptor.id)) ) ) ).supervised(supervisor) ) }