Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

holtwick/zerva-module-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌱 Zerva Module Template

This is a side project of Zerva

Start writing a module for Zerva by using this project as a template.

Checklist

  • Adjust name and author in package.json
  • In src/index.ts change the event definitions and write your own useXYZModule

You can build using

npm run build

ZContextEvents

Define 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
  }
}

useXYZModules

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
}

About

🌱 Create Zerva modules easily

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project