[Help] Extension/core questions #8361
Unanswered
emulienfou
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Related to the Intercept action point:
const observer: ContextObserver = {
// Only interested in bindings tagged with `foo`
filter: binding => binding.tagMap.model != null,
observe(event: ContextEventType, binding: Readonly<Binding<unknown>>) {
console.log(binding)
},
};
this.subscribe(observer) How can I subscribe to
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello community, I've got multiple questions regarding some core features of Loopback 4 and creating an extension.
Hope you will be able to help by putting on the right path.
Decorator
When using a decorator, can we use the MetadataInspector to get all classes who are using the decorator without having to bind the class before?
The idea here would be to:
Intercept action
Is it possible to intercept using maybe an interceptor/observer to intercept an action before the repository is creating/updating a model?
The idea here would be to intercept this event to be able to generate a slug (set a value to a specific property) before inserting/updating a model in the database.
Mixin
Can a mixin can be registered from an extension component without extending and wrapping the mixin in the Application instance?
By example to avoid having to do that:
class MyApplication extends SeedMixin(Application) {}
The idea here would be to use the custom component inside an extension to extend/wrap the custom Application when registering the custom component.
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions