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

Translate Module declaration #51

Open
F0rsaken opened this issue Jan 23, 2023 · 0 comments
Open

Translate Module declaration #51

F0rsaken opened this issue Jan 23, 2023 · 0 comments
Labels

Comments

@F0rsaken
Copy link
Member

F0rsaken commented Jan 23, 2023

Proposed API

defineModule(() => {
	const { options, on, off, emit } = useModule();
	const app = useApp();

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

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

useApp, onInit and onDestroy will detect if context is from a module or a component. There will be helper function specific for that.

Also, additional on, off and emit methods will be added, which should make less needed to use app for managing events.

@F0rsaken F0rsaken added the v3 label Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant