This is a side project of Zerva
Start writing a module for Zerva by using this project as a template.
- Adjust name and author in
package.json - In
src/index.tschange the event definitions and write your ownuseXYZModule
You can build using
npm run buildDefine your own Zerva Context events, which will be available for autocompletion in any good Typescript IDE to be used in on and emit:
declare global {
interface ZContextEvents {
counterIncrement(counter: number): void
}
}Export your useXYZModule. Good practice is to add a register call to set the modules name and its dependencies:
export function useXYZModule() {
register("xyzmodule", ["http"])
// ... your code
}