PromiseLogic.nor()

Composite Logic GateNOR Logic - NOT OR logic, succeeds when all Promises fail

The PromiseLogic.nor() method implements NOR (NOT OR) logic gate semantics, succeeding when all Promises fail, suitable for complete system failure detection and disaster recovery scenarios.

Syntax

javascript
 PromiseLogic.nor(iterable)

Parameters

ParameterTypeDescription
iterableIterable<Promise<T>>An iterable collection of Promise objects

Return Value

Returns a Promise that resolves to true when all Promises fail, otherwise resolves to false.

Promise<boolean>

Behavior

Success Condition

When all Promises fail, returned Promise resolves to true.

Failure Condition

When at least one Promise succeeds, returned Promise resolves to false.

Examples

Basic Usage

NOR Logic Example - Succeeds when all Promises fail

JAVASCRIPT
Loading...

Error Handling

NOR Logic Example - At least one succeeds

JAVASCRIPT
Loading...

Real Application

Complete system failure detection

JAVASCRIPT
Loading...

Important Notes

  • NOR logic is negation of OR logic, outputs true when all inputs are false
  • Suitable for scenarios detecting complete system failure
  • Returns boolean value for emergency situation judgment
  • Can be used to build disaster recovery mechanisms