These are chat archives for canjs/canjs

18th
Sep 2015
Adam L Barrett
@BigAB
Sep 18 2015 04:05

Looking for advice here:
Here is a simplified example of something in an app I am working on
http://codepen.io/BigAB/pen/3fcb3150295251256b102d2561df120a?editors=101

It’s basically a checkbox, that has to make a service call to change some state.
What’s potrayed in the pen is sort of what is hapenning now in the app (though in the example it errors on the 11th request), you click the checkbox, but the state doesn’t change until the request finishes. On error it doesn’t successfully change. The problems is UX related, for example if you hammer it twice, it will change underneath you after the first response returns. Also it is just annoying to see the spinner and wait.

I think I’d like to have it just change the state, make the request, and report and revert the state if the re is an error. But then I still end up with some weirdness when hammering on the thign a few times. What do you think the best way to handle this UI issue is, assuming I cannot change the service?

avg6003
@avg6003
Sep 18 2015 06:06
how to remove trailing '#!' which automatically added in the url?
David Luecke
@daffl
Sep 18 2015 14:50
It isn't added if you don't use can.route. You could also use can.route.pushtate
Fred Daoud
@foxdonut
Sep 18 2015 15:39
so this is where you all are now... :)
David Luecke
@daffl
Sep 18 2015 15:39
You found us. No way on hiding ;)
Fred Daoud
@foxdonut
Sep 18 2015 15:40
@tracer99 ratted you out to me ;)
Gregg Roemhildt
@roemhildtg
Sep 18 2015 23:16
Hi all, somewhat new to CanJS, and I'm running into an issue using deferred. Its probably something obvious but when I have a component with a deferred in its viewModel, and multiple components are placed on the page, resolving one deferred resolves each of the components deferred(s). My intent was to have each component use its own deferred and have them resolve individually. Any suggestions? http://jsfiddle.net/qf0wr63w/8/