I hope these will answer your two points:
- No need for npm. This is a library for the browser. Unless you're using tools like
browserify
, npm packages are mainly server side packages. Grab this https://github.com/gajus/swing/blob/master/dist/swing.min.js and place it inside your Meteor project under client/compatibility
as that's where you should place any external libraries.
From there you are safe to use the library (inside the Template.tinder.onRendered()
of course):
stack.on('throwout', function (e) {
console.log('Card has been thrown out of the stack.');
console.log('Throw direction: ' + (e.throwDirection == Card.DIRECTION_LEFT ? 'left' : 'right'));
});
- You can't really rely on the events from jQuery in this case as your library has different hooks, so event handling will be made as explained above.
JSYK, the code below will not do anything in Meteor (even throw an Error), I recommend you follow their github README for all events, hooks and callback names.
Template.tinder.events({
'throwout .card li': function(e) {
}
});