3 ms·
That’s basically dependency injection
by aaomidi 3y ago
That’s basically dependency injection
- LouisSayers 3y agoYes, that's my point - they're giving an example for why "you can't do it", and I'm saying even for the example they just gave you can. Create a Timeout class and subscribe to it for a given interval with a callback to what needs to be run. Pass it in as a dependency which can be mocked during testing. Not sure why the downvotes...