Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API #48

Open
F0rsaken opened this issue Sep 23, 2022 · 0 comments
Open

New API #48

F0rsaken opened this issue Sep 23, 2022 · 0 comments
Labels
enhancement New feature or request v3

Comments

@F0rsaken
Copy link
Member

Add new API along side current class based one. It would similar to Vue composables or React hooks, where you would delcare all in a special init function.

Example:

export defineComponent((ctx) => {
    const param = useDataParam('param');

    ctx.$on('click', () => {
        // ...
    })

    onInit(() => {
        // called on init
        console.log(param.value)
    })

    onBeforeDestroy(() => {
        // ...
    })

    onDestroy(() => {
        // ...
    })
})
@F0rsaken F0rsaken added enhancement New feature or request v2.3 labels Sep 23, 2022
@F0rsaken F0rsaken added v3 and removed v2.3 labels Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v3
Projects
None yet
Development

No branches or pull requests

1 participant