Skip to content

Commit

Permalink
Rename registration function
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrlpld committed Feb 18, 2024
1 parent 9d13459 commit 1b754eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion laces/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def media(self) -> Media:
_servables = {}


def servable(name: str) -> "Callable[[type[Component]], type[Component]]":
def register_servable(name: str) -> "Callable[[type[Component]], type[Component]]":
def decorator(component_class: type[Component]) -> type[Component]:
_servables[name] = component_class
return component_class
Expand Down
4 changes: 2 additions & 2 deletions laces/test/example/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from django.utils.html import format_html

from laces.components import Component, servable
from laces.components import Component, register_servable


if TYPE_CHECKING:
Expand All @@ -21,7 +21,7 @@
from laces.typing import RenderContext


@servable("renders-fixed-content-template")
@register_servable("renders-fixed-content-template")
class RendersTemplateWithFixedContentComponent(Component):
template_name = "components/hello-world.html"

Expand Down

0 comments on commit 1b754eb

Please sign in to comment.