Connecting layer arrays to an effect using reduce in TypeScript - Effect Community