You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently supported hooks are function based hooks.
It could make sense to support OOP, where some business logic might be in a certain class
Consider the approach like below
# example.hooks.todo.pyclassToDo(AbstractHookArgCls):
# overriden to initiate current user argdefsetup_args(self, arg: HookArg):
self.arg=argdefsave_todo(self):
todo=self.arg.user_inputself.db.save(todo)
returnself.arg# ..
Calling the hook in template
"SAVE-TODO-STAGE":
type: textmessage: Enter the new todoon-receive: example.hooks.todo:ToDo.save_todoroutes:
"re:.*": "VIEW-TODOS-STAGE"
The text was updated successfully, but these errors were encountered:
Currently supported hooks are function based hooks.
It could make sense to support OOP, where some business logic might be in a certain class
Consider the approach like below
Calling the hook in template
The text was updated successfully, but these errors were encountered: