Add an ability to hook into the Apex/Lds/CreateComponent Actions process
See original GitHub issueDefine an ability to assign “hook” functions
List of hooks:
onPrototypeInit
- an attribute on the Lax component. The user will be able to assign function that executes only once. It will be nice to use to define global settings.onInit
- an attribute on the Lax component. It is local hook to assigne a function that executes when an actual Lax component object created. Due to internal Lax architecture, the system has Lax Prototype object and a list of local Lax objects that inherit the functionality from the Prototype object.onResolve/onSuccess
- a function to “decorate/change” a resolved value (#20) that went from the server. It will has a default implementation (empty function or not, investigating…) and a user can assign his custom function implementation (inonPrototypeInit
,onInit
hooks or locally before an actual action queueing)onReject/onError
- the same logic like foronResolve
, but this hook provides an ablity to dive into the error handling process (#19)onIncomplete
- the same logic like foronReject
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Use Lightning Components in Visualforce Pages
Add the Lightning Components for Visualforce JavaScript library to your Visualforce page using the <apex:includeLightning/> component.
Read more >How to pass record id From VF page to Lightning component?
Your issue seems to be on this line action.setParams({"recordId":recordId}); in doInit function. Do you have the method newrfiopportunity in ...
Read more >Use Lightning Web Components in External Website
Use Lightning Web Components (LWC) anywhere using Lightning out. You can either use authenticated version or can use on public Web site.
Read more >Panel Questions Lightning Flashcards | Chegg.com
Study Panel Questions Lightning flashcards. Create flashcards for FREE and quiz yourself with an interactive flipper.
Read more >Faith as a Principle of Action and Power
An increase of our collective faith would be a sign to the Lord that we rely on Him and trust in His power...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kvizcarra, @sergey-prishchepa thank you guys for these awesome ideas!
@kvizcarra My original idea is to provide as much flexibility for users as possible. I want to provide an ability to assign listeners/handlers on two stages:
prototype init
andlocal init
. In the case of the prototype - basically, it would be global listeners for all Lax components (invoked for all Lax component actions). Also, users can assign local listeners for every distinct Lax Prototype Child (invoked for certain Lax component actions) (prototype inheritance).Using
onPrototypeInit
andonInit
attributes as listeners is more native and straightforward, for me personally. The only one question is - is localAura.Action
invocation works as much synchronously as we need to assign listeners before firstApexAction
/LdsAction
/CreateComponentAction
completed.As you can see, the idea isn’t only an ability to assign listeners on Apex Actions. I want to add hooks for
LdsAction
(Lightning Data Service),CreateComponentAction
and maybe even for other cases.@sergey-prishchepa The approach with
aura:method
is very interesting. When I complete testing withAura.Action
, I’ll try this one and let you guys know the result. Also, I’ll try to show you how it looks like for user perspective and I hope we will find the best approach!Thank you guys again for your contribution!
onPrototypeInit
andonInit
will be defined?onResolve/onSuccess
and the similar ones are defined. Will theonPrototypeInit
andonInit
functions be called with an object that allows us to defineonResolve/onSuccess
?