We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff468a6 commit 108f485Copy full SHA for 108f485
promises/app.js
@@ -40,10 +40,11 @@ function getPosts(){
40
},1000);
41
}
42
43
-function createPost(post){
+function createPost(post,callback){
44
setTimeout(()=>{
45
posts.push(post)
46
+ callback();
47
},2000)
48
-getPosts();
49
-createPost({title:"Post three",body:"This is post three"})
+
50
+createPost({title:"Post three",body:"This is post three"},getPosts)
0 commit comments