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

Support for traversing upwards in an element in a tree #208

Open
kylef opened this issue Jan 3, 2019 · 0 comments
Open

Support for traversing upwards in an element in a tree #208

kylef opened this issue Jan 3, 2019 · 0 comments

Comments

@kylef
Copy link
Member

kylef commented Jan 3, 2019

For example, given I have a reference element, I should be able dereference it.

Given the following tree called, structures

const element = {
  element: 'array',
  content: [
    {
      element: 'dataStructure',
      meta: {
        id: {
          element: 'string',
          content: 'User',
        }
      },
      content: {
        element: 'object',
        content: [
          {
            element: 'member',
            content: {
              key: {
                element: 'string',
                content: 'last_comment'
              },
              value: {
                element: 'ref',
                content: 'Comment'
              }
            }
          }
        ]
      }
    },
    {
      element: 'dataStructure',
      meta: {
        id: {
          element: 'string',
          content: 'Comment',
        }
      }
    }
  ]
};

Given I have a reference to the User dataStructure as user:

const last_comment = user.get('last_comment');
last_comment.dereference();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant