use-upbit-api
Advanced tools
Comparing version 2.0.7 to 2.0.8
{ | ||
"name": "use-upbit-api", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "This is React Custom Hook for upbit api", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -49,5 +49,11 @@ # use-upbit-api | ||
```tsx | ||
const {isLoading, marketCodes} = useFetchMarketCode( | ||
(options = {debug: false}), // default option, can be modified. | ||
); | ||
import {useFetchMarketCode} from 'use-upbit-api'; | ||
function Component() { | ||
const {isLoading, marketCodes} = useFetchMarketCode( | ||
(options = {debug: false}), // default option, can be modified. | ||
); | ||
//... | ||
} | ||
``` | ||
@@ -66,16 +72,24 @@ | ||
```tsx | ||
const [targetMarketCode, _] = useState([ | ||
{ | ||
market: 'KRW-BTC', | ||
korean_name: '비트코인', | ||
english_name: 'Bitcoin', | ||
}, | ||
... | ||
]); | ||
import { useWsTicker } from "use-upbit-api"; | ||
const {socket, isConnected, socketData} = useWsTicker( | ||
targetMarketCode, // should be array | ||
onError, // onError?: (error: Error) => void // optional, user for using ErrorBoundary | ||
(options = {throttle_time: 400, debug: false}), // default option, can be modified. | ||
); | ||
function Component() { | ||
const [targetMarketCode, _] = useState([ | ||
{ | ||
market: 'KRW-BTC', | ||
korean_name: '비트코인', | ||
english_name: 'Bitcoin', | ||
}, | ||
... | ||
]); | ||
const {socket, isConnected, socketData} = useWsTicker( | ||
targetMarketCode, // should be array | ||
onError, // onError?: (error: Error) => void // optional, user for using ErrorBoundary | ||
(options = {throttle_time: 400, debug: false}), // default option, can be modified. | ||
); | ||
// ... | ||
} | ||
``` | ||
@@ -88,13 +102,19 @@ | ||
```tsx | ||
const [targetMarketCode, _] = useState({ | ||
market: 'KRW-BTC', | ||
korean_name: '비트코인', | ||
english_name: 'Bitcoin', | ||
}); | ||
import {useWsOrderbook} from 'use-upbit-api'; | ||
const {socket, isConnected, socketData} = useWsOrderbook( | ||
targetMarketCode, // should be above form object | ||
onError, // onError?: (error: Error) => void // optional, user for using ErrorBoundary | ||
(options = {throttle_time: 400, debug: false}), // default option, can be modified. | ||
); | ||
function Component() { | ||
const [targetMarketCode, _] = useState({ | ||
market: 'KRW-BTC', | ||
korean_name: '비트코인', | ||
english_name: 'Bitcoin', | ||
}); | ||
const {socket, isConnected, socketData} = useWsOrderbook( | ||
targetMarketCode, // should be above form object | ||
onError, // onError?: (error: Error) => void // optional, user for using ErrorBoundary | ||
(options = {throttle_time: 400, debug: false}), // default option, can be modified. | ||
); | ||
// ... | ||
} | ||
``` | ||
@@ -108,13 +128,19 @@ | ||
```tsx | ||
const [targetMarketCode, _] = useState({ | ||
market: 'KRW-BTC', | ||
korean_name: '비트코인', | ||
english_name: 'Bitcoin', | ||
}); | ||
import {useWsTrade} from 'use-upbit-api'; | ||
const {socket, isConnected, socketData} = useWsTrade( | ||
targetMarketCode, // should be above form object | ||
onError, // onError?: (error: Error) => void // optional, user for using ErrorBoundary | ||
(options = {throttle_time: 400, max_length_queue: 100, debug: false}), // default option, can be modified. | ||
); | ||
function Component() { | ||
const [targetMarketCode, _] = useState({ | ||
market: 'KRW-BTC', | ||
korean_name: '비트코인', | ||
english_name: 'Bitcoin', | ||
}); | ||
const {socket, isConnected, socketData} = useWsTrade( | ||
targetMarketCode, // should be above form object | ||
onError, // onError?: (error: Error) => void // optional, user for using ErrorBoundary | ||
(options = {throttle_time: 400, max_length_queue: 100, debug: false}), // default option, can be modified. | ||
); | ||
// ... | ||
} | ||
``` | ||
@@ -121,0 +147,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76864
168