Skip to content
New issue

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

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

Already on GitHub? # to your account

Should original return plain values as-is? #605

Closed
dimaqq opened this issue May 25, 2020 · 1 comment · Fixed by boardgameio/boardgame.io#796
Closed

Should original return plain values as-is? #605

dimaqq opened this issue May 25, 2020 · 1 comment · Fixed by boardgameio/boardgame.io#796

Comments

@dimaqq
Copy link

dimaqq commented May 25, 2020

I've been writing code like:

case "A":
  draft.a = action.a
  draft.result = compute(action.a, original(draft.b));
  return;
case "B"
  draft.b = action.b
  draft.result = compute(original(draft.a), action.b);
  return;

And later it turned out to have a bug: original returns undefined on values that cannot be proxied. And of course, my a was raw string input. More importantly, what if draft.a type is variable?

I wonder what prompted the design decision for the original api.

Perhaps it would be better / less error-prone if plan values were returned as is, rather than undefined?

@aleclarson
Copy link
Member

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants