Skip to content

UX Client Script Debug State #1576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions UX Client Scripts/debug-state/debug-state.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @param {params} params
* @param {api} params.api
* @param {any} params.event
* @param {any} params.imports
* @param {ApiHelpers} params.helpers
*/
function handler({ api, event, helpers, imports }) {
console.log(`DEBUG State:`, { ...api.state });
}
23 changes: 23 additions & 0 deletions UX Client Scripts/debug-state/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Debug State UX Client Script

This repository contains a UX Client Script called `Debug State`, designed to log the current client state to the console. This script is useful for developers who want to inspect the state object in real time, making debugging more efficient by allowing quick access to current state values.

## Features

- **Console Logging of State**: Logs the entire `state` object to the console, enabling developers to track and inspect state changes.
- **Efficient Debugging**: Simplifies the debugging process by providing direct access to the client's state.

## Script Overview

```javascript
/**
* @param {params} params
* @param {api} params.api
* @param {any} params.event
* @param {any} params.imports
* @param {ApiHelpers} params.helpers
*/
function handler({ api, event, helpers, imports }) {
console.log(`DEBUG State:`, { ...api.state });
}
```
Loading