Closed guilleiguaran closed 7 years ago
👍 I too am using webpacker; having this library published to NPM would be really great!
Thanks @guilleiguaran.
@rylnd - I am not an expert in NPM, but I have published the package on npmjs: https://www.npmjs.com/package/data-confirm-modal. Can you check it works? Unfortunately the README is shared at the moment, and mentions Ruby/Rails installation instructions. A pull to have separate READMEs for the NPM is welcome!
Cheers,
@guilleiguaran @vjt thanks for the work and the quick turnaround! Unfortunately the default behavior does not work for me as I do not have jQuery
defined globally when the function is executed. I'm thinking that the basic behavior should modified to the following: if module
is defined, then export a function that takes jQuery
as an argument; if module
is not defined, then simply invoke the function in the current context (as it currently does). If that sounds good to you, I can have a PR ready in a little while.
@rylnd looks good, I will review the PR gladly. We should also split the code in multiple files for better composability - but that's a successive refactoring PR :)
Thanks!
New Rails projects can use Webpacker so is good to support them adding a package.json