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

Putting a can.compute on a Component scope throws #1086

Closed
matthewp opened this issue Jun 13, 2014 · 7 comments
Closed

Putting a can.compute on a Component scope throws #1086

matthewp opened this issue Jun 13, 2014 · 7 comments
Assignees
Labels
Milestone

Comments

@matthewp
Copy link
Contributor

Will attach a test shortly.

matthewp added a commit to matthewp/canjs that referenced this issue Jun 13, 2014
@daffl daffl added this to the 2.1.2 milestone Jun 13, 2014
@justinbmeyer
Copy link
Contributor

A "single" value compute like this will blow up, but why would you use that? A function compute should work just fine. prop: can.compute(function(){}).

A Component is probably not necessary. You could probably get this with a map:

can.Map.extend({
  prop: can.compute(false)
})

This probably has to do with compute's clone method.

@matthewp
Copy link
Contributor Author

That's true, probably no reason to do it this way. One of our existing apps this was working in 2.0.4.

@matthewp
Copy link
Contributor Author

Tested and this doesn't break on a can.Map.

@daffl daffl modified the milestone: 2.1.2 Jun 16, 2014
@daffl
Copy link
Contributor

daffl commented Jun 16, 2014

This changed from 2.0 to 2.1. Closing this issue as it can be fixed by setting it as a property instead of a value compute as discussed.

@daffl daffl closed this as completed Jun 16, 2014
@justinbmeyer
Copy link
Contributor

I'm not sure it should be closed. It still technically a bug.

@daffl daffl added this to the 2.1.3 milestone Jun 16, 2014
@daffl
Copy link
Contributor

daffl commented Jun 16, 2014

Ok. Reopening and putting it int 2.1.3.

@daffl daffl reopened this Jun 16, 2014
@daffl daffl modified the milestones: 2.1.4, 2.1.3 Jun 18, 2014
@daffl daffl modified the milestones: 2.2.0, 2.1.4 Nov 14, 2014
@daffl daffl modified the milestones: 2.3.0, 2.2.0 Feb 18, 2015
alexisabril pushed a commit that referenced this issue Oct 2, 2015
@alexisabril
Copy link
Contributor

This was fixed in a prior merge in minor. Typo in the test, adding @matthewp's test to a PR.

@daffl daffl closed this as completed Oct 22, 2015
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

4 participants