Is there a way to know what changed on an after save? This would be to trigger async jobs and refresh denormalized data.
Thanks, this make sense. Not lets say I have the current model as it is in the DB, so that I am able to know what will be changing onSave in the "before save" hook.
Do you have any suggestion on passing that data to the 'after save' hook? Would it be possible to keep part of the ctx of the new observe hooks between the before and the after? This would allow me to perform actions based on the initial state of my model.
before save: ctx.fieldWillChange = true
Right now, we end up using the currentContext at too many places to keep various states between before and after. But it makes for fragile code when we end up using scripts / jobs that are not remote and do not create a currentContext.
--
You received this message because you are subscribed to a topic in the Google Groups "LoopbackJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/loopbackjs/RRHbqNI1GTY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/531af808-7b5d-4282-8742-dd5d8f75ac62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.