mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-11-16 18:15:09 +00:00
86bf655842
* Remove redundant changelog line * The change should NOT affect most developers ;)
913 B
913 B
- 💥[Feature] Simplify the hooks API. The modules
tutor.hooks.actions
,tutor.hooks.filters
, andtutor.hooks.contexts
are no longer part of the API. This change should not affect most developers, who only use theActions
andFilters
classes (notice the plural) fromtutor.hooks
. (by @regisb)- Instead of
tutor.hooks.actions.get("some:action")
, usetutor.hooks.Actions.SOME_ACTION
. - Instead of
tutor.hooks.filters.get("some:filter")
, usetutor.hooks.Filters.SOME_FILTER
. - Instead of
tutor.hooks.actions.add("some:action")
, usetutor.hooks.Actions.SOME_ACTION.add()
. The same applies to thedo
method. - Instead of
tutor.hooks.filters.add("some:filter")
, usetutor.hooks.Filters.SOME_FILTER.add()
. The same applies to theadd_item
,add_items
,apply
, anditerate
methods. - Instead of
tutor.hooks.contexts.enter
, usetutor.core.hooks.contexts.enter
.
- Instead of