@adriansteffan/reactive 0.0.44 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import { useState, useRef } from 'react';
3
- import { ExperimentRunner, BaseComponentProps, ExperimentConfig, registerSimulation } from '@adriansteffan/reactive';
3
+ import { ExperimentRunner, BaseComponentProps, ExperimentConfig, registerSimulation, registerFlattener } from '@adriansteffan/reactive';
4
4
 
5
5
 
6
6
  const config: ExperimentConfig = { showProgressBar: true };
@@ -34,6 +34,10 @@ const CustomTrial = ({ next, maxCount }: BaseComponentProps & { maxCount: number
34
34
  );
35
35
  };
36
36
 
37
+ // Register a flattener to control how this trial's data appears in the CSV.
38
+ // 'customtrial' is the default CSV file name — override per-item with the csv field.
39
+ registerFlattener('CustomTrial', 'customtrial');
40
+
37
41
  // Register a simulation for the custom trial.
38
42
  // The decision function determines how fast the participant clicks.
39
43
  // The simulate function uses the trial logic (clicking maxCount times) to produce response data.