Cyberpull Wiki

...a new world...

User Tools

Site Tools


opensource:ngsuite:serialguard

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
opensource:ngsuite:serialguard [2023/03/23 00:52] – created - external edit opensource:ngsuite:serialguard [2023/03/27 11:50] (current) christian
Line 1: Line 1:
 ====== NGSuite: Serial Guard ====== ====== NGSuite: Serial Guard ======
  
-NGSuite's SerialGuard is a feature that makes it possible to call multiple route guards in tandem. There are two types of Serial Guard: The ''SerialGuard'' decorator and the ''SerialGuardFn'' function. Both the ''SerialGuard'' decorator and the ''SerialGuardFn'' accept the ''SerialGuardInfo'' object as an argument+NGSuite's SerialGuard is a feature that makes it possible to call multiple route guards in tandem. There are two types of Serial Guard: The [[opensource:ngsuite:api:serialguard|SerialGuard]] decorator and the [[opensource:ngsuite:api:serialguardfn|SerialGuardFn]] function. Both the [[opensource:ngsuite:api:serialguard|SerialGuard]] decorator and the [[opensource:ngsuite:api:serialguardfn|SerialGuardFn]] accept the [[opensource:ngsuite:api:serialguardinfo|SerialGuardInfo]] object as an argument.
- +
-===== SerialGuardInfo ===== +
- +
-The ''SerialGuardInfo'' object consists of only 2 properties: +
- +
-  * entries: Chain<GuardEntry>[]; +
-  * providers?: StaticProvider[]; +
- +
-The ''entries'' property contains a list of Classes that implement the ''GuardEntry'' interface. These are guard entries that will be called serially. +
- +
-The optional ''providers'' property contains a list of providers that can be injected into each guard entry.+
  
 ===== Creating a Guard Entry ===== ===== Creating a Guard Entry =====
Line 29: Line 18:
 </codify> </codify>
  
-===== SerialGuard =====+===== Using the SerialGuard Decorator =====
  
-The ''SerialGuard'' decorator is used with a class to generate a master route guard that chains up the guard entries for serial execution.+The [[opensource:ngsuite:api:serialguard|SerialGuard]] decorator is used with a class to generate a master route guard that chains up the guard entries for serial execution.
  
-==== Usage ====+==== Example ====
  
-Creating a serial guard with the ''SerialGuard'' decorator:+Creating a serial guard with the [[opensource:ngsuite:api:serialguard|SerialGuard]] decorator:
  
 <codify typescript> <codify typescript>
Line 49: Line 38:
 </codify> </codify>
  
-===== SerialGuardFn =====+===== Using the SerialGuardFn Function =====
  
-The ''SerialGuardFn'' function generates a master route guard that chains up the guard entries for serial execution.+The [[opensource:ngsuite:api:serialguardfn|SerialGuardFn]] function generates a master route guard that chains up the guard entries for serial execution.
  
-==== Usage ====+==== Example ====
  
-Creating a serial guard with the ''SerialGuardFn'' function:+Creating a serial guard with the [[opensource:ngsuite:api:serialguardfn|SerialGuardFn]] function:
  
 <codify typescript> <codify typescript>
-const UserAccessGuard = SerialGuardFn({+export const UserAccessGuard = SerialGuardFn({
   entries: [   entries: [
     AuthGuardEntry,     AuthGuardEntry,
opensource/ngsuite/serialguard.1679532723.txt.gz · Last modified: 2023/03/23 00:52 by