Skip to content

Commit eeff463

Browse files
added: fix errors in the doc
1 parent 26b3e95 commit eeff463

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@ Modern images loader helpers written in es2015 using generators and promises
1313
```js
1414
import { loadImage } from 'bianco.images-loader'
1515

16-
loadImage('path/to/the/image.jpg')
17-
.then(img => document.body.appendChild(img))
18-
.catch(function(error) {
19-
// there was an error loading the image
20-
})
21-
16+
loadImage('path/to/the/image.jpg').then(img => document.body.appendChild(img))
2217
```
2318

2419
Or also DOM nodes:
@@ -27,7 +22,11 @@ Or also DOM nodes:
2722
import $ from 'bianco.query'
2823
import { loadImage } from 'bianco.images-loader'
2924

30-
loadImage($('img.cool')).then(img => img.classList.add('loaded'))
25+
loadImage($('img.cool'))
26+
.then(img => img.classList.add('loaded'))
27+
.catch(function(error) {
28+
// there was an error loading the image
29+
})
3130
```
3231

3332
#### Load a multiple images
@@ -36,9 +35,9 @@ loadImage($('img.cool')).then(img => img.classList.add('loaded'))
3635
import { loadImages } from 'bianco.images-loader'
3736

3837
loadImages([
39-
'path/to/the/image1.jpg',
40-
'path/to/the/image2.jpg'
41-
])
38+
'path/to/the/image1.jpg',
39+
'path/to/the/image2.jpg'
40+
])
4241
.then(img => document.body.appendChild(img))
4342
.catch(error => {
4443
// there was an error loading one of images

0 commit comments

Comments
 (0)