9.13.2 • Published 5 months ago

@kduse/core v9.13.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

KdUse

Collection of essential Kdu Composition Utilities

🚀 Features

  • 🎪 Interactive docs & demos
  • 🕶 Seamless migration: Works for both Kdu 3 and 2
  • Fully tree shakeable: Only take what you want, bundle size
  • 🦾 Type Strong: Written in TypeScript, with TS Docs
  • 🔋 SSR Friendly
  • 🌎 No bundler required: Usable via CDN
  • 🔩 Flexible: Configurable event filters and targets
  • 🔌 Optional Add-ons: Router, Firebase, RxJS, etc.

🦄 Usage

import { useLocalStorage, useMouse, usePreferredDark } from '@kduse/core'

export default {
  setup() {
    // tracks mouse position
    const { x, y } = useMouse()

    // is user prefers dark theme
    const isDark = usePreferredDark()

    // persist state in localStorage
    const store = useLocalStorage(
      'my-storage',
      {
        name: 'Apple',
        color: 'red',
      },
    )

    return { x, y, isDark, store }
  },
}

📦 Install

🎩 From v4.0, it works for Kdu 2 & 3 within a single package by the power of kdu-demi!

npm i @kduse/core

CDN

<script src="https://unpkg.com/@kduse/shared"></script>
<script src="https://unpkg.com/@kduse/core"></script>

It will be exposed to global as window.KdUse

📄 License

MIT License