sprinkles
sprinkles copied to clipboard
A little sugar for your vanilla JS 🍦
Allows you to do something like this: ``` js var animals = ["cats", "dogs", "fish"]; "cats".$in(animals); // => true "llama".$in(animals); // => false ```
If the browser supports Promises and XHR method isn't given a success or error callback, the it's safe to assume the caller wants a Promise to be returned. I like...
Give the project a home.
Maybe just use the `$()` just like jQuery but call down to `document.querySelectorAll()` instead. Just to save some keystrokes.
Going along with #38, it would also be great to be able to easily tell a form to submit asynchronously. In other projects, I've had a way to say "submit...
Sprinkles has a basic `$get()` and `$getJSON()`, which address 90% of my daily needs. I almost never do a POST but it seems incomplete not to have it.
There's a clever solution I cooked up to make it super easy to show and hide content when you click on stuff. The basic idea is to add an attribute...
A super common helper I use all the time is `autoFocusFirstInput()`. It actually has some edge cases that are annoying to solve over and over again. Another one is `disableButtonsWhileFormsSubmit()`....