Unify anchor, path, grid snap to a targets array

interact('*').draggable({
  snap: {
    targets: [
      // snap to this point
      { x: 100, y: 100, range: 25 },

      // give this function the x and y page coords
      // and snap to the object returned
      function (x, y) {
        return {
          x: x,
          y: (75 + 50 * Math.sin(x * 0.04)),
          range: 40
        };
      },

      // create a function that snaps to a grid
      interact.createSnapGrid({
        x: 50,
        y: 50,
        range: 10,              // optional
        offset: { x: 5, y: 10 } // optional
      })
    ],
    // this range is used if a target doesn't specify it's range
    range: Infinity
  }
})
Tidy snapping code
Remove snap range conversion from -1 to Infinity
Make new snapping backwards compatible
demo/snap: Use unified target snapping
Fix snap range bug