Comments (6)
I just created an issue for that case: #5
from sfdc-lax.
Released in v1.1
from sfdc-lax.
Hey @up2go-rsoesemann!
That will be added to the upcoming update.
LaxPromise
will have finally
function to do that as in standard JavaScript Promise API
from sfdc-lax.
Can't I just add a then()
after the catch()
?
component.lax.enqueue('c.apexMethod')
.then(
...
)
.catch(
...
)
.then(ignored => {
component.find("spinner").hide();
});
Any release dates for your update?
from sfdc-lax.
@up2go-rsoesemann Yes, catch()
function returns LaxPromise
which is just a child of standard Promise object. That allows you to use all the benefits if Promise API. The only one thing is that finally()
function is not adopted for Aura context yet. So you should wrap your callback with $A.getCallback()
utility when you work with finally()
.
Here is an example of your case:
component.lax.enqueue('c.getException')
.then(result => {
console.log('This statement will never be called', result);
})
.catch(errors => {
// you can handle every action with specific logic
component.set('v.message', errors[0].message);
})
.then(() => {
return component.lax.enqueue('c.getContacts');
})
.then(contacts => {
component.set('v.contacts', contacts);
})
from sfdc-lax.
@up2go-rsoesemann I'm going to release finally()
and other features at the end of the week, or earlier.
from sfdc-lax.
Related Issues (20)
- Finally doesn't work as expected HOT 3
- Add the link to Deploy to SalesforceDX
- Questions about storable and background actions HOT 3
- Is there a finally on "cmp.lax.action"? HOT 1
- setFinally function for LaxActionBuilder HOT 3
- [extension] Make LAX code "compliant" with Lightning Linter HOT 2
- [bug] this._contextPromise.finally is not a function in Firefix 47 (not in 48) HOT 20
- How to JS-throw error in then() to be catched in catch() HOT 6
- Add error parser / normaliser HOT 2
- Add a flag to automatically `JSON.parse` response from Apex HOT 2
- Add an ability to hook into the Apex/Lds/CreateComponent Actions process HOT 11
- Winter 19
- "Freeze JavaScript Prototypes" Session Setting in Winter '19 breaks Lax HOT 6
- Add record reload method to LDS helper HOT 3
- Recommended Migration to Lightning Web Components HOT 3
- Error overriding Promise prototype methods when "Freeze JavaScript Prototypes" is on HOT 2
- An ability to call Lightning Data Service component function within Lax context HOT 1
- An ability to set action callback without Aura context wrapper - `$A.getCallback()`
- An option to handle `"INCOMPLETE"` server-side action state in `.catch()` callback HOT 1
- An ability to fire an Application/Component event using Builder Pattern manner HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sfdc-lax.