1.0.11 • Published 6 years ago

react-worker-image v1.0.11

Weekly downloads
40
License
ISC
Repository
github
Last release
6 years ago

react-worker-image

React component to fetch image resources via web workers

react-worker-image is a React component for loading images via a web worker. Thereby not blocking the main thread and speeding up page load time.

Installation

Using npm

npm install react-worker-image

yarn add react-worker-image

Usage

react-worker-image exports one react component which takes src as a prop, and an optional prop of placeholder, style and imageClass which are applied to the img tag.

const ImageWorker = require('react-worker-image').default;

or

import ImageWorker from 'react-worker-image';

usage in code

<ImageWorker src='http://image-url' />

Props List

Prop typeRequiredtype
srcyesstring
placeholderoptionalstring or Component
styleoptionalObject
imageClassoptionalstring
containerClassoptionalstring

The above props are applied to the img tag.

Found a bug file them here.

Component in Action

Observe the page Load time at the bottom right corner in both cases.

The first is via a webworker and the second is the regular get.

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago