@@ -41,31 +41,30 @@ so that is empty in the table.
4141 useMemo(async () => {
4242 await loadTable(store, 'genres');
4343+ store.setTable('metadata', {
44- + genre1 : {text: 'Dramatic movies to make you think', popularity: 6},
45- + genre2 : {text: 'These ones make you laugh', popularity: 7},
46- + genre3 : {text: 'Fun for all the family', popularity: 8},
47- + genre4 : {text: 'For the romantics at heart', popularity: 5},
48- + genre5 : {text: 'From cartoons to CGI', popularity: 5},
49- + genre6 : {text: 'Escape to another world', popularity: 4},
50- + genre7 : {text: 'Tales of the American West', popularity: 3},
51- + genre8 : {text: 'Stay on the edge of your seat', popularity: 6},
52- + genre9 : {text: 'For your inner explorer', popularity: 7},
53- + genre10 : {text: 'Fast-paced action from start to finish', popularity: 8},
54- + genre11 : {text: 'Jump scares to give you nightmares', popularity: 6},
55- + genre12 : {text: 'Murders and mysteries', popularity: 5},
56- + genre14 : {text: 'Take a step back in time', popularity: 3},
57- + genre15 : {text: 'A glimpse of the future', popularity: 8},
58- + genre16 : {text: 'Who did it?', popularity: 5},
44+ + g01_meta : {text: 'Dramatic movies to make you think', popularity: 6},
45+ + g02_meta : {text: 'These ones make you laugh', popularity: 7},
46+ + g03_meta : {text: 'Fun for all the family', popularity: 8},
47+ + g04_meta : {text: 'For the romantics at heart', popularity: 5},
48+ + g05_meta : {text: 'From cartoons to CGI', popularity: 5},
49+ + g06_meta : {text: 'Escape to another world', popularity: 4},
50+ + g07_meta : {text: 'Tales of the American West', popularity: 3},
51+ + g08_meta : {text: 'Stay on the edge of your seat', popularity: 6},
52+ + g09_meta : {text: 'For your inner explorer', popularity: 7},
53+ + g10_meta : {text: 'Fast-paced action from start to finish', popularity: 8},
54+ + g11_meta : {text: 'Jump scares to give you nightmares', popularity: 6},
55+ + g12_meta : {text: 'Murders and mysteries', popularity: 5},
56+ + g14_meta : {text: 'Take a step back in time', popularity: 3},
57+ + g15_meta : {text: 'A glimpse of the future', popularity: 8},
58+ + g16_meta : {text: 'Who did it?', popularity: 5},
5959+ });
6060 setIsLoading(false);
6161 }, []);
6262```
6363
64- In the main ` App `
65- component, we can create the memoized Relationships object, and create the
66- relationship between the the genres Table and the 'remote' metadata Table. Note
67- that we concatenate the word 'genre' and the genre Id to get the remote Row Id
68- in the metadata table.
64+ In the main ` App ` component, we can create the memoized Relationships object,
65+ and create the relationship between the the genres Table and the 'remote'
66+ metadata Table. Note that we concatenate the genre Id and '\_ meta' to link the
67+ rows from the two tables together.
6968
7069``` diff-js
7170 const store = useCreateStore(createStore);
@@ -74,7 +73,7 @@ in the metadata table.
7473+ 'genresMetadata',
7574+ 'genres',
7675+ 'metadata',
77- + (_, rowId) => 'genre' + rowId ,
76+ + (_, rowId) => rowId + '_meta' ,
7877+ ),
7978+);
8079```
0 commit comments