Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. var func1 = function(){
  2. return new promise(function(resolve, reject){
  3. //some operations here
  4. });
  5. };
  6.  
  7. var func2 = function(){
  8. promise.resolve(someFuncSync())
  9. .then(function(){
  10. //this is the old promise chain
  11.  
  12. func1()
  13. .then(function(message,error){
  14. return message;
  15. //i want use this return value in old promise chain
  16. });
  17.  
  18. console.log(message);
  19. //printing func1 returned message in old promise chain
  20. })
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement