Available book apis
React​
use-book exports several hooks and components that can handle different book:
Hook | Description |
---|---|
useBook | Handles the book info |
Usage​
const state = useBook(props)
return <img src={state.src}>
props
is an object containing options for the bookstate
is an object containing all attributes of the book.
Components is a shorthand for passing hooks directly to children.
return (
<UseBook {...props}>
{state => <img src={state.src} />}
</UseNote>
)
// or
return (
<UseNote as="div" {...props}/>
)
Performance pitfalls​
URL
value | https://{HOST}/images/P/{ASIN/ISBN}.{COUNTRY}.{SIZE} |
---|---|
HOST | images-na.ssl-images-amazon.com or images-jp.amazon.com |
ISBN | International Standard Book Number |
ASIN | Amazon Standard Identification Number |
COUNTRY | Japan:09 |
SIZE
value | key | mean | w*h size | book size | notes |
---|---|---|---|---|---|
THUMBZZZ | xs | samnale | 75×75 | 52×75 | |
TZZZZZZZ | sm | small | 110×110 | 77×110 | |
MZZZZZZZ | md | middle | 160×160 | 112×160 | |
LZZZZZZZ | lg | large | 500×500 | 349×500 | if h<500, return Full size image |