Thomvis / BrightFutures

Write great asynchronous code in Swift using futures and promises
MIT License
1.9k stars 184 forks source link

Move extension for DispatchTimeInterval to test targets #199

Closed mathebox closed 5 years ago

mathebox commented 6 years ago

Removes extension from framework, but still allows usage in tests.

Fixes #194

Thomvis commented 6 years ago

Thanks for your contribution!

I'm not sure if we should keep the extensions in the test target though. I think tests should reflect usage of plain BrightFutures as much as reasonably possible. This helps us uncover ergonomics issues or breaking changes during development.

What do you think?

mathebox commented 6 years ago

Good point!

I personally like this extension and have copied it into some of my projects. However you are perfectly able to use BrightFutures without using DispatchTime. And in case you use it, it's only some convenience helper. On the downside, it can lead to conflicts as described in #194.

If you want to encourage the usage of extension, we could add it as a snippet in the Readme file and advise users to copy it to their code base.

What are your thoughts on this idea?

Thomvis commented 5 years ago

I've shared the extension before in a separate gist (https://gist.github.com/Thomvis/b378f926b6e1a48973f694419ed73aca), we could link to that from a new "Useful links" section in the readme.

mathebox commented 5 years ago

I added a section for delay to the readme, which refers to the gist. A "Useful links" section could be added later on when there are multiple useful links.

Thomvis commented 5 years ago

Thanks a lot!