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

v2 docs Pseudos versus Jasmine tests #190

Closed
ghost opened this issue Nov 9, 2017 · 0 comments
Closed

v2 docs Pseudos versus Jasmine tests #190

ghost opened this issue Nov 9, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 9, 2017

So, I'm a bit confused here because I can't get the action, onAdd, or onRemove functions to fire.

Do these fire when the element is added, removed, or have an event fired?

In the v2 beta docs it says the following --

xtag.pseudos.example = {
  onAdd: function(){
    /*
      This function is fired once when the base function is added to
      the target object. For instance:

      If you added an event with xtag.addEvent(someNode, 'tap:example', fn),
      the onAdd function of the 'example' pseudo would be fired once when
      the event is first attached to the element 'someNode'.
    */

  },
  onRemove: function(){
    /*
      This is basically the opposite of the onAdd function above.
      With onRemove, you can clean up whatever you may have done
      in your onAdd or action function invocations.
    */
  },
  action: function(pseudo, event) {
    /*
      This function is fired each time the pseudo chain is fired.
      Pseudo actions are fired in the order they are chained, meaning
      the in the pseudo 'toggle:log:example', the action function
      for the 'log' pseudo would fire first, then the 'example' action
      and finally the base function 'toggle' they are chained to.
    */
  }
};

but in the jasmine tests it's done like the folowing--

xtag.pseudos.foo = {
      onInvoke(){
        count++;
      }
    }
@ghost ghost closed this as completed Mar 27, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants