about summary refs log tree commit diff stats
path: root/js/scripting-lang/web/src/state.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/web/src/state.js')
-rw-r--r--js/scripting-lang/web/src/state.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/scripting-lang/web/src/state.js b/js/scripting-lang/web/src/state.js
new file mode 100644
index 0000000..0bfada6
--- /dev/null
+++ b/js/scripting-lang/web/src/state.js
@@ -0,0 +1,18 @@
+// state.js
+// App state definition and helpers
+
+export const initialState = {
+  query: '',
+  pokemon: null,
+  evolutionChain: null,
+  evolutionData: null, // Transformed by Baba Yaga
+  babaYagaScript: '', // User's transformation script
+  scriptOutput: null, // Results from Baba Yaga execution
+  scriptError: null, // Baba Yaga script execution errors
+  loading: false,
+  error: null
+};
+
+export function cloneState(state) {
+  return JSON.parse(JSON.stringify(state));
+} 
\ No newline at end of file