Skip to content

Commit

Permalink
adds secondary index argument for path and tick in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Knape committed Jun 15, 2017
1 parent 69f6f7e commit fa1eace
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import th from 'triggerhappy';
th.fire('TouchEvent', 'touchstart');
const clip = th.load('TouchEvent', 'touchmove');
th.spray(clip, {
path: ({touches}) => {
path: ({touches}, index) => {
// Always good to extend the object so we
// return the same keys
return touches: touches.map((touch, i) => {
Expand All @@ -83,7 +83,7 @@ const touches = th.touches(th.position(img, {x: 40, y: 50}), th.position(img, {x
th.fire('TouchEvent', 'touchstart', img);
const clip = th.load('TouchEvent', 'touchmove', img, touches);
th.spray(clip, {
path: ({touches}) => ({
path: ({touches}, index) => ({
// Always good to extend the object so we
// return the same keys
return touches: touches.map((touch, i) => {
Expand Down Expand Up @@ -225,8 +225,8 @@ const clip = th.load('TouchEvent', 'touchmove', {clientX, clientY});
th.spray(clip, {
speed: 10,
steps: 10,
path: (event) => (event),
tick: () => {},
path: (event, index) => (event),
tick: (event, index) => {},
})
.then(({clientX, clientY}) => {
// and finally when we are done we end the cycle with a touchend event
Expand Down

0 comments on commit fa1eace

Please sign in to comment.