@@ -2,34 +2,48 @@ import codegen from "postman-code-generators";
2
2
import { Request } from "postman-collection" ;
3
3
import React , { useEffect } from "react" ;
4
4
import styled from "styled-components" ;
5
+ import shallow from "zustand/shallow" ;
5
6
6
7
import CopyIcon from "../../../components/CopyIcon" ;
7
8
import SelectWrapper from "../../../components/SelectWrapper" ;
8
9
import { COMMON , HEIGHT , OPTION } from "../../../constants" ;
9
10
import CodeEditor from "../../../shared/CodeEditor" ;
10
- import useKeyValueTableStore from "../../../store/keyValueTableStore" ;
11
- import useRequestStore from "../../../store/requestStore" ;
11
+ import useStore from "../../../store/useStore" ;
12
12
import { generateSdkRequestObject } from "../../../utils" ;
13
13
import vscode from "../../../vscode" ;
14
14
15
15
const RequestCodeSnippet = ( ) => {
16
16
const {
17
+ authData,
17
18
requestUrl,
18
- requestMethod,
19
19
authOption,
20
- authData,
21
20
bodyOption,
22
- bodyRawOption,
23
21
bodyRawData,
22
+ requestMethod,
23
+ bodyRawOption,
24
+ codeSnippetValue,
25
+ keyValueTableData,
24
26
codeSnippetOption,
27
+ setCodeSnippetValue,
25
28
handleCodeSnippetOptionChange,
26
29
handleCodeSnippetVariantChange,
27
- codeSnippetValue,
28
- setCodeSnippetValue,
29
- } = useRequestStore ( ) ;
30
-
31
- const keyValueTableData = useKeyValueTableStore (
32
- ( state ) => state . keyValueTableData ,
30
+ } = useStore (
31
+ ( state ) => ( {
32
+ authData : state . authData ,
33
+ requestUrl : state . requestUrl ,
34
+ authOption : state . authOption ,
35
+ bodyOption : state . bodyOption ,
36
+ bodyRawData : state . bodyRawData ,
37
+ requestMethod : state . requestMethod ,
38
+ bodyRawOption : state . bodyRawOption ,
39
+ codeSnippetValue : state . codeSnippetValue ,
40
+ keyValueTableData : state . keyValueTableData ,
41
+ codeSnippetOption : state . codeSnippetOption ,
42
+ setCodeSnippetValue : state . setCodeSnippetValue ,
43
+ handleCodeSnippetOptionChange : state . handleCodeSnippetOptionChange ,
44
+ handleCodeSnippetVariantChange : state . handleCodeSnippetVariantChange ,
45
+ } ) ,
46
+ shallow ,
33
47
) ;
34
48
35
49
const handleCopyIconClick = ( value ) => {
0 commit comments