Skip to content

Commit 28ac499

Browse files
authored
simulating an API call and remove loader
1 parent a74f760 commit 28ac499

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Placeload
5555

5656
import Placeload from 'placeload.js'
5757

58-
const userContainer = Placeload
58+
const userLoader = Placeload
5959
.$('.user-placeload')
6060
.config({speed: '2s'})
6161
.line((element) => element.width(300).height(200))
@@ -67,10 +67,16 @@ const userContainer = Placeload
6767
.line((element) => element.width(250).height(20))
6868

6969

70-
userContainer.fold(
70+
userLoader.fold(
7171
(err) => console.log('error: ', err),
7272
(allElements) => console.log('allElements: ', allElements)
7373
)
74+
75+
API.getUsers()
76+
.then(users => {
77+
userLoader.remove()
78+
}
79+
)
7480
```
7581

7682
![](https://github.com/victorvoid/placeload.js/blob/master/docs/imgs/placeload_example.gif)

0 commit comments

Comments
 (0)