Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeetiss/supa-images-loader
https://github.com/jeetiss/supa-images-loader
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeetiss/supa-images-loader
- Owner: jeetiss
- Created: 2018-03-05T07:26:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T07:07:57.000Z (over 6 years ago)
- Last Synced: 2024-09-26T19:49:13.770Z (7 days ago)
- Language: JavaScript
- Homepage: https://jeetiss.github.io/supa-images-loader/
- Size: 444 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# supa images loader
simple function for load images
### install with npm
```
install supa-images-loader --save
```### install with yarn
```
yarn add supa-images-loader
```### example
```js
import loadImages from 'supa-images-loader'const div = document.querySelector('#example')
div.innerText = 'loading...'
loadImages(
'https://ucarecdn.com/fd6c74d1-3c88-4f2c-8f81-48064132fd0d/-/resize/402x/',
'https://ucarecdn.com/4a15dea0-4e61-4ee1-ac49-71d2daa6462e/-/resize/402x/',
'https://ucarecdn.com/250cbd47-4779-4d15-9666-de9c0c9b2f84/-/resize/402x/'
).then(images => {
div.innerText = ''return images
}).then(
images => images
.filter(([, error]) => !error)
.forEach(([image]) => div.appendChild(image))
)
```