UNPKG

@nolikein/typed-alpinejs

Version:

Helpers usefull to create a new AlpineJs component with Livewire 3

17 lines (14 loc) 674 B
import { Alpine } from "@nolikein/types-livewire3"; import { AlpineWired } from "@nolikein/types-livewire3"; /** * Create an AlpineJs component. It ensures the developper pass the Alpine data. */ export function createAlpineComponent<AlpineData>(component: Alpine.AlpineComponent<AlpineData>) { return component; } /** * Create an AlpineJs component. It ensures the developper pass the Alpine data, and can register any livewire data and methods. */ export function createAlpineLivewireComponent<AlpineData, LivewireData, LivewireMethods>(component: AlpineWired.AlpineComponent<AlpineData, LivewireData, LivewireMethods>) { return component; }