npm.io
1.0.0-beta.0 • Published 2 years ago

pdf-retina

Licence
MIT
Version
1.0.0-beta.0
Deps
0
Size
545 B
Vulns
0
Weekly
0
Stars
2

pdf-retina

PDF preview component for mobile with Retina display support

When multiple requests are made to the same interface in a short period of time, pdf-retina can be useful if you need to ensure that the request executed first returns the results first

NPM version Codacy Badge tree shaking typescript Test coverage npm download gzip License

Sonar

DocumentationChange Log

Read this in other languages: English | 简体中文

Experience online

Experience the pdf-retina features online Edit in CodeSandbox

Installing

# use pnpm
$ pnpm install pdf-retina

# use npm
$ npm install pdf-retina --save

Usage

Add serializer feature to axios
import wrapper from 'pdf-retina'

const pdfRetina = wrapper(axios, {
  // unique: false,
  // orderly: true
})

export default pdfRetina
or axios instance
import wrapper from 'pdf-retina'

const pdfRetina = wrapper(instance, {
  // unique: false,
  // orderly: true
})

export default pdfRetina

API Reference

pdfRetina

axios serializer wrapper function

  • Since: 1.0.0

  • Arguments:

Parameters Description Type Optional Required Default
instance axios or axios instance AxiosInstance axios/axiosInstance true -
options serializer options SerializerOptions - false -
  • Returns: new axios instance with serializer

  • Example:

const http = pdfRetina(instance, {
  // unique: false,
  // orderly: true
})
  • Types:
function axiosWithSeries<T = any, R = AxiosResponse<T>, D = any>(
  config: SerializerRequestOptions<D>
): Promise<R>
function axiosWithSeries<T = any, R = AxiosResponse<T>, D = any>(
  url: string,
  config?: SerializerRequestOptions<D>
): Promise<R>
Using unpkg CDN
<script src="https://unpkg.com/pdf-retina@1.0.0/dist/index.global.prod.js"></script>
<script>
  const http = pdfRetina(axios)
</script>

Support & Issues

Please open an issue here.

License

MIT