diff --git a/lib/slideHelper.js b/lib/slideHelper.js index fc8a714..b61fab7 100644 --- a/lib/slideHelper.js +++ b/lib/slideHelper.js @@ -26,7 +26,7 @@ const startSliding = (k, predicate, host, guest, window, windowPos) => { const test = predicate ? predicate : isEq; - const firstMatch = host.findIndex(wrap(isEq, window[0])); + const firstMatch = host.findIndex(wrap(test, window[0])); // If first item returns a match, then continue to slideNext() const len = firstMatch ? slideNext(host, guest, firstMatch, windowPos) : undefined; diff --git a/test.js b/test.js index 2d21dda..0dad246 100644 --- a/test.js +++ b/test.js @@ -3,5 +3,5 @@ const Slider = require('.'); const a = [ 0, 1, 2, 3, 4, 5 ]; const b = [ 2, 3, 4 ]; -const w = new Slider({ size: 3 }); +const w = new Slider({ size: 3 , predicate: (a, b) => a === b }); console.log(w.slide(a, b)); \ No newline at end of file