|
4 | 4 | "body": [ |
5 | 5 | "<View className=\"flex-1 items-center justify-center\">", |
6 | 6 | " $1", |
7 | | - "</View>" |
| 7 | + "</View>", |
8 | 8 | ], |
9 | | - "description": "A Simple View " |
| 9 | + "description": "A Simple View ", |
10 | 10 | }, |
11 | 11 | "Text": { |
12 | 12 | "prefix": "t", |
13 | 13 | "body": [ |
14 | 14 | "<Text variant=\"body\" className=\"text-center\">", |
15 | 15 | " $1", |
16 | | - "</Text>" |
| 16 | + "</Text>", |
17 | 17 | ], |
18 | | - "description": "A Simple Text" |
| 18 | + "description": "A Simple Text", |
19 | 19 | }, |
20 | 20 | "export *": { |
21 | 21 | "prefix": "ex *", |
22 | 22 | "body": ["export * from '.$1';"], |
23 | | - "description": "export *" |
| 23 | + "description": "export *", |
24 | 24 | }, |
25 | 25 | "Component": { |
26 | 26 | "prefix": "comp", |
|
39 | 39 | " </View>", |
40 | 40 | " );", |
41 | 41 | "};", |
42 | | - "" |
| 42 | + "", |
43 | 43 | ], |
44 | | - "description": "Component" |
| 44 | + "description": "Component", |
45 | 45 | }, |
46 | 46 | // https://snippet-generator.app/?description=useQuery+with+variables&tabtrigger=useqv&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createQuery+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%27%3B%0A%0Atype+Variables+%3D+%7B%243%7D%3B%0Atype+Response+%3D+%7B%244%7D%3B%0A%0Aexport+const+use%241+%3D+createQuery%3CResponse%2C+Variables%2C+AxiosError%3E%28%7B%0A++queryKey%3A+%5B%27%242%27%5D%2C+%0A++fetcher%3A+%28variables%29+%3D%3E+%7B%0A++++return+client%0A++++++.get%28%60%242%2F%5C%5C%24%7Bvariables.%24%7B5%7D%7D%60%29%22%2C%0A++++++.then%28%28response%29+%3D%3E+response.data%29%3B%0A++%7D%2C%0A%7D%29%3B%0A&mode=vscode |
47 | 47 | "useQuery with variables": { |
|
63 | 63 | " .then((response) => response.data);", |
64 | 64 | " },", |
65 | 65 | "});", |
66 | | - "" |
| 66 | + "", |
67 | 67 | ], |
68 | | - "description": "useQuery with variables" |
| 68 | + "description": "useQuery with variables", |
69 | 69 | }, |
70 | 70 | //https://snippet-generator.app/?description=useQuery&tabtrigger=useq&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createQuery+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%27%3B%0A%0Atype+Response+%3D+%7B%243%7D%3B%0Atype+Variables+%3D+void%3B%0A%0Aexport+const+use%241+%3D+createQuery%3CResponse%2C+Variables%2C+AxiosError%3E%28%7B%0A++queryKey%3A+%5B%27%242%27%5D%2C%0A++fetcher%3A+%28%29+%3D%3E+%7B%0A++++return+client.get%28%60%242%60%29.then%28%28response%29+%3D%3E+response.data.posts%29%3B%0A++%7D%2C%0A%7D%29%3B%0A&mode=vscode |
71 | 71 | "useQuery": { |
|
85 | 85 | " return client.get(`$2`).then((response) => response.data.posts);", |
86 | 86 | " },", |
87 | 87 | "});", |
88 | | - "" |
| 88 | + "", |
89 | 89 | ], |
90 | | - "description": "useQuery" |
| 90 | + "description": "useQuery", |
91 | 91 | }, |
92 | 92 | //https://snippet-generator.app/?description=useInfiniteQuery&tabtrigger=useiq&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createInfiniteQuery+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%2Fclient%27%3B%0Aimport+%7B+DEFAULT_LIMIT%2C+getNextPageParam+%7D+from+%27..%2Fcommon%2Futils%27%3B%0Aimport+type+%7B+PaginateQuery+%7D+from+%27..%2Ftypes%27%3B%0A%0Atype+Response+%3D+void%3B%0Atype+Variables+%3D+PaginateQuery%3C%243%3E%3B%0A%0Aexport+const+use%241+%3D+createInfiniteQuery%3CResponse%2C+Variables%2C+AxiosError%3E%28%7B%0A++queryKey%3A+%5B%27%242%27%5D%2C%0A++fetcher%3A+%28_variables%3A+any%2C+%7B+pageParam+%7D%29%3A+Promise%3CResponse%3E+%3D%3E+%7B%0A++++return+client%28%7B%0A++++++url%3A+%60%2F%242%2F%60%2C%0A++++++method%3A+%27GET%27%2C%0A++++++params%3A+%7B%0A++++++++limit%3A+DEFAULT_LIMIT%2C%0A++++++++offset%3A+pageParam%2C%0A++++++%7D%2C%0A++++%7D%29.then%28%28response%29+%3D%3E+response.data%29%3B%0A++%7D%2C%0A++getNextPageParam%2C%0A++initialPageParam%3A+0%2C%0A%7D%29%3B&mode=vscode |
93 | 93 | "useInfiniteQuery": { |
|
117 | 117 | " },", |
118 | 118 | " getNextPageParam,", |
119 | 119 | " initialPageParam: 0,", |
120 | | - "});" |
| 120 | + "});", |
121 | 121 | ], |
122 | | - "description": "useInfiniteQuery" |
| 122 | + "description": "useInfiniteQuery", |
123 | 123 | }, |
124 | 124 |
|
125 | 125 | //https://snippet-generator.app/?description=useMutation+&tabtrigger=usem&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createMutation+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%27%3B%0A%0Atype+Variables+%3D+%7B%243%7D%3B%0Atype+Response+%3D+%7B%244%7D%3B%0A%0Aexport+const+use%241+%3D+createMutation%3CResponse%2C+Variables%2C+AxiosError%3E%28%0A++async+%28variables%29+%3D%3E%0A++++client%28%7B%0A++++++url%3A+%27%242%27%2C%0A++++++method%3A+%27POST%27%2C%0A++++++data%3A+variables%2C%0A++++%7D%29.then%28%28response%29+%3D%3E+response.data%29%0A%29%3B&mode=vscode |
|
141 | 141 | " method: 'POST',", |
142 | 142 | " data: variables,", |
143 | 143 | " }).then((response) => response.data)", |
144 | | - "});" |
| 144 | + "});", |
145 | 145 | ], |
146 | | - "description": "useMutation " |
| 146 | + "description": "useMutation ", |
147 | 147 | }, |
148 | 148 | "navigate": { |
149 | 149 | "prefix": "navigate", |
150 | 150 | "body": ["const { navigate } = useNavigation();", ""], |
151 | | - "description": "navigate" |
152 | | - } |
| 151 | + "description": "navigate", |
| 152 | + }, |
153 | 153 | } |
0 commit comments