johannschopplich / kirby-blurry-placeholder

🖼 Blurry image placeholders for better UX
MIT License
65 stars 3 forks source link

Publish useLazyload as npm package #8

Closed arnoson closed 3 years ago

arnoson commented 3 years ago

I really like your updated version of lozad!

Right now, importing it from the plugin folder seems a bit verbose:

import { useLazyload } from '../site/plugins/kirby-blurry-placeholder/src/useLazyload'

Would be great to just have an npm package. Or is there a shorter way to import it?

johannschopplich commented 3 years ago

You may set up an alias in your config, but that would be just another work-around. Probably a good idea to push the library to npm. Will keep that in mind.

johannschopplich commented 3 years ago

Hey @arnoson, it took me some time, but I have managed to finally rewrite the lazy loading hook in TypeScript: https://github.com/johannschopplich/loadeer (usage stays the some, it's a drop-in replacement).

I will keep the old hook in the project for compatibility reasons. But you can now just use the 🦌 loadeer npm package!

Head over to the improved readme of the Kirby plugin to see a list of new features, like embedding the library without a build step.

I'm glad you like the library. 🙂

arnoson commented 3 years ago

Wow, looks like the perfect lazy loading library! Thank you very much (: