File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
src/components/templates/mappings Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 DataMap ,
1313 DataSet ,
1414 DataComplete ,
15+ DataLoop ,
1516} from ' @site/src/components/templates/mappings/eventConfig' ;
1617import Link from ' @docusaurus/Link' ;
1718
@@ -124,6 +125,8 @@ to a `WalkerOS.Property`.
124125Loops over the first parameter and maps the second to the current value. It is
125126used for creating an array of dynamic length.
126127
128+ <DataLoop />
129+
127130### condition
128131
129132Is a function to check if the mapping should be used. It returns a boolean, if
Original file line number Diff line number Diff line change 1+ import type { Mapping } from '@elbwalker/types' ;
12import { getEvent } from '@elbwalker/utils' ;
23import { DestinationPush } from '../destination' ;
34
@@ -9,23 +10,25 @@ export const destination = {
910 } ,
1011} ;
1112
12- const string = 'data.total' ;
13+ const string : Mapping . Data = 'data.total' ;
1314
14- const key = {
15+ const key : Mapping . Data = {
1516 key : 'data.id' ,
1617} ;
1718
18- const map = {
19+ const map : Mapping . Data = {
1920 map : {
2021 pageGroup : 'globals.pagegroup' ,
2122 shoppingStage : 'context.shopping.0' ,
2223 } ,
2324} ;
2425
25- const set = {
26+ const set : Mapping . Data = {
2627 set : [ 'trigger' , 'entity' , 'action' ] ,
2728} ;
2829
30+ const loop : Mapping . Data = { loop : [ 'nested' , 'data.name' ] } ;
31+
2932export const DataString : React . FC = ( ) => {
3033 return (
3134 < DestinationPush event = { { data : event . data } } mapping = { { data : string } } />
@@ -60,6 +63,15 @@ export const DataSet: React.FC = () => {
6063 ) ;
6164} ;
6265
66+ export const DataLoop : React . FC = ( ) => {
67+ return (
68+ < DestinationPush
69+ event = { { nested : event . nested } }
70+ mapping = { { data : loop } }
71+ />
72+ ) ;
73+ } ;
74+
6375export const DataComplete : React . FC = ( ) => {
6476 return (
6577 < DestinationPush
You can’t perform that action at this time.
0 commit comments