-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What is the problem this feature would solve?
Would be awesome to have access to the current instance sstore + decorators in the cron handler.
As of right now, I'm using smth like this to retrieve params from decorators / store :
const baseApp = new Elysia().decorate({someStuff: "test"})
export const demoCron = (app: typeof baseApp) => app.use(
cron({
name: "demo",
pattern: Patterns.everyMinutes(30),
run: async () => {
// Get some stuff from the app
const {
someStuff
} = app.decorator;
},
})
)Not a huge fan of this design (but it's working)
I've tried a few different way to "correct" this, by implementing custom cron, with custom generics etc, but tbh I'm new to Elysia and a bit lost in it's types ahah
What is the feature you are proposing to solve the problem?
Updating the cron run method of the cron plugin, to accept the current Elysia instance store + decorators as params
What alternatives have you considered?
No response
Thanaen, fearandesire, nabby27, ajgribble, aboqasem and 1 more
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request