-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feature request: Custom RxDocument decorators #165
Comments
Actually, instead of having a methods object you give, would be nice to just give a class. This could then be extended by the RxDocument. This would also solve the getter issue we had before! |
I think adding a preCreate hook is an excellent idea. It would make everything more flexible. |
Done here |
Just curious: postCreate was made non-async, was there a reason? I have a use case that would be nice to have async, but if its technically a lot harder it's not a problem. |
@natew postCreate was made non-async for implementation-reasons. If it could be async, next to every methode of rxdb would have been async. |
Case
When you write a query and exec(), you get a list back of RxDocuments. Typically you can define methods() to add methods to them, but this isn't very flexible. This may be a more advanced use case, but for example I want to extend documents in a variety of ways. One would be adding observable values onto them. Another would be adding specific getters. Etc, etc.
Issue
Can't really hook into the internals to do this. Idea would be to be able to hook into preCreate for an RxDocument and decorate the instance or the class (or both).
The text was updated successfully, but these errors were encountered: