Skip to content
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

don't throw exception when assign a primitive value to @observable.shallow? #1336

Closed
grayflow opened this issue Feb 2, 2018 · 5 comments
Closed

Comments

@grayflow
Copy link

grayflow commented Feb 2, 2018

or make @observale shallow by default?

@jamiewinder
Copy link
Member

It doesn't make sense to use @observable.shallow with anything that isn't a collection, so throwing if you try to seems sensible?

@urugator
Copy link
Collaborator

urugator commented Feb 2, 2018

@jamiewinder you may not know the type of the value during definition ... the @observable.deep also doesn't throw on primitives, even though it also doesn't make sense...

@grayflow
Copy link
Author

grayflow commented Feb 5, 2018

the requirement is exactly as @jamiewinder pointed out!
for now(before 4.0), is there any simple way to make observable shallow when assigned an "builtin container" value like array or es6 map?

@grayflow
Copy link
Author

grayflow commented Feb 5, 2018

maybe not to make assumption in api can lead to better api? just provide reasonable defaults and leave room for customization.

@mweststrate
Copy link
Member

Closing in favor of the discussion in #1316, which basically makes the same point :)

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

No branches or pull requests

4 participants