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

Hooks conception problem #7

Closed
jcheron opened this issue Nov 20, 2020 · 1 comment
Closed

Hooks conception problem #7

jcheron opened this issue Nov 20, 2020 · 1 comment
Assignees
Labels
conception invalid This doesn't seem right

Comments

@jcheron
Copy link
Contributor

jcheron commented Nov 20, 2020

VueHooks

The VueHooks class is useless.
With java, it doesn't exist and the Hooks are stored in a Map, so they should probably be in an associative array in PHP.

Code repetitions

A lot of code repetition with the event adding methods, it should be factorized, since only the name of the event changes:

	public function onMounted(string $body) {
	    $vh=new VueHook($body);
		$this->addHook("mounted", body);
		$this->script['mounted']=$vh->__toString();
	}
@jcheron jcheron added invalid This doesn't seem right conception labels Nov 20, 2020
@jguillaumesio
Copy link
Contributor

https://github.com/phpMv/php-vuejs/tree/ff452736127e6df4d34981998265faad9b7acc2f

Modified in this commit, hooks are now stored in an associative array with their name as index, hooks class deleted

@jcheron jcheron closed this as completed Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conception invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants