Recursively Check Array Length Until Value Changes in TypeScript - Effect Community