-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Consider implementing Symbol.toPrimitive on boxed primitives. #561
Comments
Hi @urugator, want to understand the relevance of
Then modifying timer and logging the values similar to the example... and it seems like console.log works just fine with boxed observables. I was running this in node 6.5.0 without any extra flags. What am I missing? Can you maybe provide a snippet/file which does not work as expected for you and write down the expected result? Regarding implementation of your proposal: I added
after get() in lib/types/observablevalue.ts which at least compiles (with a warning about Running just the code from MDN in a node console worked fine however, so I suspect the environment is OK, but I'm missing the use case. |
However, I meant this:
I am sorry for not being specific enough. |
Thanks for the clarification. I think you were specific enough but I am a noob in mobx ;) Using your example and the change I already wrote above, I get this result:
I think this exactly what you were expecting, isn't it? However, the simple change I outlined in the above comment has some issues:
With some more TypeScript magic added, maybe you could make it work without warnings. However looking at microsoft/TypeScript#2361 there will be more challenges to make that happen. |
I am actually not sure about |
I would love to give this a shot. 👍 |
Released as part of 3.0.2. Thanks for the PR @eladnava ! |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive
The text was updated successfully, but these errors were encountered: