Skip to content

Conversation

jfrolich
Copy link

@jfrolich jfrolich commented Jul 13, 2021

This ignore will be more strict than the standard ignore function because it will only match Promise.t<'a>

This helps to find potential bugs:

  • Where there is no promise returned (found 2 cases in the tests that didn't need ignore)
  • Where there is some partly applied function (ignore will happily accept, and nothing will happen)

Especially the second case has caused bugs for us so we eliminated the general ignore from our codebase.

I called the function ignorePromise so it doesn't shadow when opened. It might be ok to shadow, and then we have the slightly nicer Promise.ignore.

@ryyppy
Copy link
Owner

ryyppy commented Jul 19, 2021

sounds like a legit usecase, just wondering if ignorePromise is a good name... what about done()?

@jfrolich
Copy link
Author

sounds like a legit usecase, just wondering if ignorePromise is a good name... what about done()?

Done sounds great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants