Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

WatchGroups: allow to attach/detach/move them #32

Description

@tbosch

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.

Activity

  1. tbosch commented on May 21, 2014

    @tbosch
    ContributorAuthor

    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 digested
    • remove() - remove the group from its parent. Should allow the group to be added somewhere else afterwards.
  2. tbosch commented on May 21, 2014

    @tbosch
    ContributorAuthor

    @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?

  3. changed the title [-]Add suspend/resume functionality for WatchGroups[/-] [+]WatchGroups: allow to attach/detach/move them[/+] on May 21, 2014
  4. EisenbergEffect commented on May 21, 2014

    @EisenbergEffect
    Contributor

    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.com

  5. EisenbergEffect commented on May 21, 2014

    @EisenbergEffect
    Contributor

    We 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.com

    Rob Eisenberg,
    President - Blue Spire
    www.durandaljs.com

  6. tbosch commented on May 21, 2014

    @tbosch
    ContributorAuthor

    Ok, 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
    .

  7. EisenbergEffect commented on May 23, 2014

    @EisenbergEffect
    Contributor

    @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.

  8. tbosch commented on May 23, 2014

    @tbosch
    ContributorAuthor

    We had a hangout to clarify the issues...

  9. tbosch commented on Jun 5, 2014

    @tbosch
    ContributorAuthor

    Hi,
    there seems to be a bug when watching PureFunctions. The following test fails when rootWatchGrp.addGroup(watchGrp); is done after creating the watch, but passes when done the other way around

        iit('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]);
        });
    
  10. tbosch commented on Jun 5, 2014

    @tbosch
    ContributorAuthor

    And the newGroup(context) function should only be available in RootWatchGroup...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions