PromiseLogic.allFulfilled()
Extended FeatureGet all successful results, always returns a successful result array
The PromiseLogic.allFulfilled() method returns all successful results as an array, ignoring failed results. It returns a PromiseWithTimer instance which wraps native Promise and provides additional functionality.
Syntax
javascript PromiseLogic.allFulfilled(iterable)
Parameters
| Parameter | Type | Description |
|---|---|---|
| iterable | Iterable<PromiseLike<unknown>> | An iterable collection of Promise objects |
Return Value
Returns a PromiseWithTimer that resolves to an array of values from all successful Promises (may be empty).
PromiseWithTimer<unknown[]>Behavior
Success Condition
Waits for all Promises to complete, then returns a PromiseWithTimer that resolves to an array of values from all successful Promises.
Special Case
The allFulfilled method never fails, even if all Promises fail it will return an empty array.
Examples
Basic Usage
Get all successful operation results
JAVASCRIPT
Loading...
Timeout Control
Add timeout control with maxTimer method
JAVASCRIPT
Loading...
Batch Operation Analysis
Analyze batch operation execution
JAVASCRIPT
Loading...
Real Application
Fault-tolerant data loading with timeout
JAVASCRIPT
Loading...
Important Notes
- • allFulfilled always returns successful results, even if all Promises fail it returns an empty array
- • Returns PromiseWithTimer which supports maxTimer() for timeout control
- • maxTimer can only detect timeout, cannot cancel Promise operation itself
- • Suitable for scenarios where you need to get successful results without caring about failures
- • Can be combined with other logic gates to build more complex control flows
- • Returned array only contains values from successful Promises, no failure information