@adriansteffan/reactive 0.1.0 → 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.
- package/README.md +10 -0
- package/dist/{mod-D9lwPIrH.js → mod-Beb0Bz3s.js} +921 -919
- package/dist/mod.d.ts +2 -0
- package/dist/reactive.es.js +31 -30
- package/dist/reactive.umd.js +30 -30
- package/dist/{web-DXP3LAJm.js → web-DOXm98lr.js} +1 -1
- package/dist/{web-DUIQX1PV.js → web-aMUVS_EB.js} +1 -1
- package/package.json +1 -1
- package/src/components/canvasblock.tsx +2 -8
- package/src/mod.tsx +1 -1
- package/src/utils/upload.ts +10 -0
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:
|