Events Example
import * as ramapi from "ram-api.js"; // typescript
const ramapi = require("ram-api.js"); // javascript
const apiEvent = ramapi.Events;
// listion
apiEvent.on("package-update", (data) => {
console.log(data);
});
//emit to change settings or stop event loops
apiEvent.emit("stop-update-check"); // will stop the update checker that binds to package-update
apiEvent.emit("start-update-check"); // will start the update checker that binds to package-update will stop first if already running to avoid duplicates
Listenable Events
package-update
Emit Events
stop-update-check
start-update-check