Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw Error If Subscriber Not Registered #7

Open
Char2sGu opened this issue Jan 13, 2024 · 1 comment
Open

Throw Error If Subscriber Not Registered #7

Char2sGu opened this issue Jan 13, 2024 · 1 comment

Comments

@Char2sGu
Copy link
Owner

Char2sGu commented Jan 13, 2024

@TheNightmareX The one thing I wish I could of done but couldn't see a path to implement was get the @SoftDeletable decorator to throw an error if the subscriber wasn't registered. If you're able to see a path forward/point me in the right direction, I could open a follow up PR.

Originally posted by @Tucker-Eric in #6 (comment)

@Char2sGu
Copy link
Owner Author

Hey @Tucker-Eric I see what you're trying to accomplish. However, it doesn't sound like a quite good practice to me.

Decorators are not supposed to do anything except of defining metadata to the target. The metadata they defined would be handled by other services.

In our case, applying a @SoftDeletable decorator to an entity class only means that the soft-delete behavior of that kind of entities has been defined, but doesn't mean that we have enabled soft-delete for it. Registering the subscriber is the way to enable the defined soft-delete behaviors.

For now I don't plan to add this feature. You could keep this issue open to see if others have some innovative opinions on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant