Here are some answers to address your concerns:
- You don't need npm for this library since it is designed for the browser. Unless you're using tools like
browserify
, npm packages are typically used for server-side functionality. Simply download the library from this link and place it in your Meteor project under client/compatibility
. This is the appropriate location for external libraries in Meteor.
Once you have added the library, you can safely utilize it within the Template.tinder.onRendered()
function:
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'));
});
- In this scenario, relying on jQuery events may not be effective because the library you are utilizing has its own event hooks. Therefore, you will need to handle events as described above.
It's important to note that the following code will not work in Meteor and could potentially result in an error. We recommend referring to the library's README on GitHub for accurate information regarding all available events, hooks, and callback names.
Template.tinder.events({
'throwout .card li': function(e) {
}
});