Skip to content

Fix map() #1271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 1, 2018
Merged

Fix map() #1271

merged 5 commits into from
Oct 1, 2018

Conversation

schmidt-sebastian
Copy link
Contributor

Turns out that using foreach() for map() doesn't quite work. These two functions do very different things:

  • Map takes the result of persistence promises and converts them to an array.
  • forEach takes a list of values and "converts" them to a PersistencePromise by passing them through a callback.

map is so far only used in a single test that doesn't look at the return values, and hence nothing broke. I changed that test to use waitFor.

Alternatively, we could also remove map, but it might come in handy and is not all that trivial to implement (as I have just shown).

@schmidt-sebastian schmidt-sebastian merged commit 950499d into master Oct 1, 2018
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt-rollforward branch October 2, 2018 16:59
@firebase firebase locked and limited conversation to collaborators Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants