Repository navigation
WatchGroups: allow to attach/detach/move them #32
Description
Activity
Actually, we need the following for templating:
RootWatchGroup:
newGroup(context):WatchGroup- will just create but not attach the group
WatchGroup:
addGroup(group:WatchGroup)- add a group to a parent group so that it gets digestedremove()- remove the group from its parent. Should allow the group to be added somewhere else afterwards.
@EisenbergEffect How far are you with your refactorings of the WatchGroups, caused by adding the observation strategy? For templating I really need this feature. Could you collaborate with @caitp to implement this?
- changed the title
[-]Add suspend/resume functionality for WatchGroups[/-][+]WatchGroups: allow to attach/detach/move them[/+]on May 21, 2014 I've made good progress on the re-factoring. I think I can probably get
this done by tomorrow if that works for you.On Wed, May 21, 2014 at 12:25 PM, Tobias Bosch notifications@github.life-white.ukwrote:
@EisenbergEffect https://github.com/EisenbergEffect How far are you
with your refactorings of the WatchGroups, caused by adding the observation
strategy? For templating I really need this feature. Could you collaborate
with @caitp https://github.com/caitp to implement this?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-43780371
.Rob Eisenberg,
President - Blue Spire
www.durandaljs.comWe might need to also add something like "destroy" which removes a group
and also releases all internals resources.On Wed, May 21, 2014 at 12:26 PM, Rob Eisenberg <rob@bluespireconsulting.com
wrote:
I've made good progress on the re-factoring. I think I can probably get
this done by tomorrow if that works for you.On Wed, May 21, 2014 at 12:25 PM, Tobias Bosch notifications@github.life-white.ukwrote:
@EisenbergEffect https://github.com/EisenbergEffect How far are you
with your refactorings of the WatchGroups, caused by adding the observation
strategy? For templating I really need this feature. Could you collaborate
with @caitp https://github.com/caitp to implement this?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-43780371
.Rob Eisenberg,
President - Blue Spire
www.durandaljs.comRob Eisenberg,
President - Blue Spire
www.durandaljs.comOk, great. If you have questions how to work with those linked lists,
@caitp knows :-)On Wed, May 21, 2014 at 9:26 AM, Rob Eisenberg notifications@github.life-white.ukwrote:
I've made good progress on the re-factoring. I think I can probably get
this done by tomorrow if that works for you.On Wed, May 21, 2014 at 12:25 PM, Tobias Bosch notifications@github.life-white.ukwrote:
@EisenbergEffect https://github.com/EisenbergEffect How far are you
with your refactorings of the WatchGroups, caused by adding the
observation
strategy? For templating I really need this feature. Could you
collaborate
with @caitp https://github.com/caitp to implement this?—
Reply to this email directly or view it on GitHub<
https://github.com/angular/watchtower.js/issues/32#issuecomment-43780371>
.Rob Eisenberg,
President - Blue Spire
www.durandaljs.com—
Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-43780583
.@tbosch I need some more info on this. What should happen if
newGroup()is called without a context? Currently, it gets the context from it's parent, but since we are creating them detached, that is no longer appropriate. What about the getter cache? What about the expression cache? All these things come from the parent, affect the internal behavior and you can't actually use the group without them. Need some more guidance before being able to proceed.We had a hangout to clarify the issues...
- added a commit that references this issue
on May 29, 2014 - added 5 commits that reference this issue
on May 29, 2014 - added a commit that references this issue
on May 29, 2014 Hi,
there seems to be a bug when watching PureFunctions. The following test fails whenrootWatchGrp.addGroup(watchGrp);is done after creating the watch, but passes when done the other way aroundiit('should dirty check function watches after attaching a child group', function() { context = {'a': 1}; var rootWatchGrp = new RootWatchGroup(new GetterCache({}), null, {}); var watchGrp = rootWatchGrp.newGroup(context); var watch = watchGrp.watchExpression(new PureFunctionAST('add', function(a) { return a+1; }, [parse('a')]), logCurrentValue); rootWatchGrp.addGroup(watchGrp); rootWatchGrp.detectChanges(); expect(logger.toArray()).toEqual([2]); });And the
newGroup(context)function should only be available inRootWatchGroup...
In the router we will have the use case to hide views from the user, and in that case, they should not be digested. However, when the view is shown again, it should be digested again.
Something like WatchGroup.suspend / WatchGroup.resume.