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

can.Map method not become computable automatically #1164

Closed
isadovskiy opened this issue Jul 11, 2014 · 9 comments
Closed

can.Map method not become computable automatically #1164

isadovskiy opened this issue Jul 11, 2014 · 9 comments
Assignees
Labels
Milestone

Comments

@isadovskiy
Copy link

Please check this minimalistic example: http://jsfiddle.net/jd44f/6/

My expectation is everything should work without wrapping team.shortName method with can.compute().

Reproduced with CanJS 2.1.2

@isadovskiy
Copy link
Author

Ok, got another example which could give some glue for Bitovi team: http://jsfiddle.net/jd44f/7/

@gsmeets
Copy link
Contributor

gsmeets commented Jul 14, 2014

Use the define get methode instead of just properties on the prototype.

@isadovskiy
Copy link
Author

Yes, it will be work around for this issue.

This post were made as bug report for future releases.

@gsmeets
Copy link
Contributor

gsmeets commented Jul 15, 2014

I don't think this is a bug. The normal" prototype properties are there for simple observables, computed properties like the one you're building should be done with the define plugin.

@isadovskiy
Copy link
Author

Please check this example: http://jsfiddle.net/jd44f/7/. It's a bug...

As for define plugin, it's just an optional plugin, which can be omitted at all.

@isadovskiy
Copy link
Author

Here is an example without define plugin: http://jsfiddle.net/jd44f/8/

@justinbmeyer
Copy link
Contributor

@isadovskiy yeah, that first fiddle should work. I'm guessing it does in older versions? I think 2.2 has a bug around leaking (not in terms of memory) can.__read calls.

@isadovskiy
Copy link
Author

Yes, it worked with 2.0.5 and stopped working after upgrade to 2.1.2

@justinbmeyer justinbmeyer added this to the 2.1.3 milestone Jul 23, 2014
@justinbmeyer justinbmeyer self-assigned this Jul 24, 2014
@justinbmeyer
Copy link
Contributor

Here's a smaller version of the first example: http://jsfiddle.net/jd44f/9/

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

No branches or pull requests

3 participants