@adriansteffan/reactive 0.1.0 → 0.1.2

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.
package/README.md CHANGED
@@ -231,6 +231,16 @@ registerFlattener('MyGame', 'games', (item) => {
231
231
 
232
232
  Each row automatically gets standard trial fields prefixed with `trial_` (`trial_index`, `trial_name`, `trial_start`, etc.) plus any metadata from the timeline item. The flattener output overwrites these if keys collide.
233
233
 
234
+ ### Array flattener
235
+
236
+ For components whose `responseData` is an array of objects (like CanvasBlock), use the built-in `arrayFlattener` instead of writing your own. Each array element becomes a CSV row with a `block` column set to the trial name:
237
+
238
+ ```tsx
239
+ import { registerFlattener, arrayFlattener } from '@adriansteffan/reactive';
240
+
241
+ registerFlattener('MyBlockTrial', 'blocks', arrayFlattener);
242
+ ```
243
+
234
244
  ### Multi-CSV components
235
245
 
236
246
  Call `registerFlattener` multiple times for one component to produce multiple CSV files: