File

libs/ngx-pfe/pfe-actions/reset-state/reset-state.model.ts

Extends

PfeBaseActionConfig

Index

Properties

Properties

excludeFromResetExpressions
excludeFromResetExpressions: JsonPathExpression[]
Type : JsonPathExpression[]
Optional

Provide an array of JSON expressions that will not be reset.

{
"onNavigationStartActions": [
{
"type": "PFE_RESET_STATE",
"excludeFromResetExpressions": ["$.myState.keepThisState", "$.importantState"]
}
]
}
type
type:

Completely reset the state.

An example use case could be to reset the state before going back to the first page:

{
"pageId": "lastPage",
"nextOptionList": [
{
"nextPageId": "firstPage"
}
],
"onNavigationStartActions": [
{
"type": "PFE_RESET_STATE"
}
]
}
import { JsonPathExpression } from '../../models/jsonpath-expression-type.model';
import { PfeBaseActionConfig } from '../pfe-actions.model';

// eslint-disable-next-line @typescript-eslint/naming-convention
export const PfeResetStateActionType = 'PFE_RESET_STATE';

export interface PfeResetStateActionConfig extends PfeBaseActionConfig {
  /**
   * Completely reset the state.
   *
   * An example use case could be to reset the state before going back to the first page:
   *
```json
{
  "pageId": "lastPage",
  "nextOptionList": [
    {
      "nextPageId": "firstPage"
    }
  ],
  "onNavigationStartActions": [
    {
      "type": "PFE_RESET_STATE"
    }
  ]
}
```
   */
  type: typeof PfeResetStateActionType;

  /**
   * Provide an array of JSON expressions that will not be reset.
```json
{
  "onNavigationStartActions": [
    {
      "type": "PFE_RESET_STATE",
      "excludeFromResetExpressions": ["$.myState.keepThisState", "$.importantState"]
    }
  ]
}
```
   */
  excludeFromResetExpressions?: JsonPathExpression[];
}

results matching ""

    No results matching ""