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

Inter-element communication: implement action threading using zippers #9

Open
4 tasks
ognen opened this issue Dec 1, 2016 · 1 comment
Open
4 tasks

Comments

@ognen
Copy link
Member

ognen commented Dec 1, 2016

Currently, if an element wishes to communicate with another element it issues a 'global' action (starts with '.', which will hit the first ancestor element in the ancestors chain that has an update for this action defined.

Introduce new way of threading actions.

  • elUpdates.thread(action, movementOrSelector, targetAction)
  • this is interpreted as an instruction to thread the current action to another location or locations
  • the movementOrSelector parameter can be
    • a zipper movement function that is used to locate the target element from the current element's locations
    • a selector (zip.select) which can be used to select one or more elements (starting from the current element's location)
    • targetAction is the the action to be triggered on each of the target elements. It is optional, and if not provided it is the same as action
  • error handling: when threading, if the action is not found on the target element, an Error is thrown
  • elUpdates.threadToFirst(action, selector, targetAction)
  • same as thread except that the action is attempted on each element defined in the selector until a recipient is found in which case the threading stops
  • deprecate "global" actions (starting with a .)
  • reimplement "global" actions using threadToFirst
@ognen ognen added the zippers label Jul 14, 2017
@ognen ognen changed the title Revisit inter-element communication Inter-element communication: implement action threading using zippers Jul 14, 2017
@ognen
Copy link
Member Author

ognen commented Jul 14, 2017

Depends on #53 for the select function.

@andon andon added this to the 1.0 milestone Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Girders Elements
In Discussion
Development

No branches or pull requests

2 participants