useJquery icon indicating copy to clipboard operation
useJquery copied to clipboard

[Feature Request] MooTools support

Open mmmeff opened this issue 5 years ago • 2 comments

My team doesn't use jQuery, we use MooTools: a collection of JavaScript utilities designed for the intermediate to advanced JavaScript developer. It allows you to write powerful and flexible code with its elegant, well documented, and coherent APIs.

Any chance we can expect support for MooTools? I'd love to see it as an option we can pass to useJquery, like:

import React, { useEffect } from 'react';
import useJquery from 'react-use-jquery';

export default function App() {
  const $$ = useJquery({ mooTools: "yes" });
  
  useEffect(() => {
    if ($$) {
      $$('.App').html('Hello world');
    }
  }, [$$]);
  
  return <div className="App" />;
}

mmmeff avatar Apr 01 '19 15:04 mmmeff

This looks perfectly within the scope of this project, I'll happily accept a PR.

Keep in mind potential conflicts with #3 though!

latviancoder avatar Apr 01 '19 17:04 latviancoder

"yes" is too deterministic for me, what if there's an error?

I think you should take a note from the HTMLMediaElement.canPlayType() API:

const $$ = useJquery({ mooTools: "probably" });

atomiks avatar Apr 01 '19 21:04 atomiks