Socket
Socket
Sign inDemoInstall

react-progressive-image-loading

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-progressive-image-loading - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

build/index.d.ts

@@ -24,3 +24,3 @@ /// <reference types="react" />

render(): JSX.Element;
private fetch(uri);
private fetch(src);
private cloneProps();

@@ -27,0 +27,0 @@ private getStyle();

@@ -46,13 +46,7 @@ "use strict";

};
ProgressiveImage.prototype.fetch = function (uri) {
ProgressiveImage.prototype.fetch = function (src) {
return new Promise(function (resolve) {
fetch(uri)
.then(function (response) { return response.blob(); })
.then(function (blob) {
var fp = new FileReader();
fp.onload = function () {
resolve(fp.result);
};
fp.readAsDataURL(blob);
});
var image = new Image();
image.src = src;
image.addEventListener("load", function () { return resolve(src); }, false);
});

@@ -59,0 +53,0 @@ };

{
"name": "react-progressive-image-loading",
"version": "1.0.7",
"version": "1.0.8",
"description": "Progressively load images using a blur effect. Edit",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -5,3 +5,6 @@ # React Progressive Image Loading

[![CircleCI](https://circleci.com/gh/wcandillon/react-progressive-image-loading.svg?style=svg)](https://circleci.com/gh/wcandillon/react-progressive-image-loading)
[![npm version](https://badge.fury.io/js/react-progressive-image-loading.svg)](https://badge.fury.io/js/react-progressive-image-loading)
![example](http://i.imgur.com/fL5Qqvj.gif)
## Installation

@@ -11,2 +14,24 @@

$ npm install react-progressive-image-loading --save
```
```
## Usage
```jsx
<ProgressiveImage preview="/images/tiny-preview.png" src="/images/preview.png" />
```
Instead of using the `img` tag, you can use `background=true` that will generate a `div` with `background-image` as inlined css.
```jsx
<ProgressiveImage preview="/images/tiny-preview.png" src="/images/preview.png" background={true} />
```
You can also customize the transition time and the timing function used for that transition.
```jsx
<ProgressiveImage preview="/images/tiny-preview.png"
src="/images/preview.png"
transitionTime={500}
transitionFunction="ease"
/>
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc