forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring re. build system and events cytoscape#1685 cytoscape#1823
- Babel support - Use lodash.debounce - Allow single object to specify Event; Only do `new Event()` in a couple places so potentially pooling could be used in future - Use .emit() and .removeListener() by default - .rtrigger() => .emitAndNotify() - .trigger() => .emit() - Removes old define code for events and adds generic Emitter - Splits up defines and allows for external deps
- Loading branch information
Showing
112 changed files
with
3,655 additions
and
3,857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ node_js: | |
- "7" | ||
- "stable" | ||
sudo: false | ||
script: npm run test-travis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ j.on('tap', function(){ | |
console.log('tap!!'); | ||
}); | ||
|
||
j.trigger('tap'); // tap!! | ||
``` | ||
j.emit('tap'); // tap!! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Examples | ||
|
||
```js | ||
cy.on('tap', function(evt, f, b){ | ||
console.log('tap', f, b); | ||
}); | ||
|
||
cy.emit('tap', ['foo', 'bar']); | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Examples | ||
|
||
For all handlers: | ||
|
||
```js | ||
cy.on('tap', function(){ /* ... */ }); | ||
|
||
// unbind all tap handlers, including the one above | ||
cy.removeListener('tap'); | ||
``` | ||
|
||
For a particular handler: | ||
|
||
```js | ||
var handler = function(){ | ||
console.log('called handler'); | ||
}; | ||
cy.on('tap', handler); | ||
|
||
var otherHandler = function(){ | ||
console.log('called other handler'); | ||
}; | ||
cy.on('tap', otherHandler); | ||
|
||
// just unbind handler | ||
cy.removeListener('tap', handler); | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.