Repository
Current version released
2 years ago
⚙ Motor
This is a starter template for building Deno packages in TypeScript, with GitHub Actions-powered CI, tests, CLI, and Semantic Release on GitHub and npm.
Start the motor
import { motor } from "https://deno.land/x/motor@0.0/mod.ts";
type Gears = Keys<"stopped" | "paused" | "playing" | "loading">;
type Events = Keys<"SELECT" | "LOAD" | "PLAY" | "PAUSE" | "STOP">;
const musicPlayer: MotorSpec<Gears, Events> = {
gear: "stopped",
transmission: {
stopped: {
on: { LOAD: "loading" },
},
paused: {
on: { PLAY: "playing", STOP: "stopped" },
},
loading: {
on: { PLAY: "playing", STOP: "stopped" },
},
playing: {
on: { PAUSE: "paused", STOP: "stopped" },
},
},
};
Development
Run tests:
deno test --allow-read
📄 License
MIT