-
Notifications
You must be signed in to change notification settings - Fork 1
Hooks
MohammadAli Arjomand edited this page Sep 6, 2023
·
3 revisions
SinglightJs has 2 Lifecycle hooks, beforeMount
and afterMount
. For use that's run this command
node singlighter make:hook beforeMount # or afterMount
This command, will create a file in ./Scripts/Hooks/beforeMount.js
export default function beforeMount() {
// codes are here
}
For working hooks, open ./Scripts/Hooks/Fisher.js
then import the Hook
import beforeMount from "./beforeMount.js";
And add it in the object
export default {
beforeMount
};
NOTE This object will import in
App.js
on line3
and pass toSinglight.hooks
on line7
MIT License, Copyright (c) 2023 MohammadAli Arjomand