0

Is there some way to cancel a query I'm running in BreeseJS. I don't really care if the query runs server side, but it would be nice if I could just call a method or something to make sure that it doesn't call the method I have assigned to the promise using then. So let's say that my code looks something like

var promise = manager.executeQuery(myFavouriteQuery);
promise.then(myFavouriteFunction);

Is there something I can do with the promise later so that it won't call the function I gave it in then.

Jay Traband
  • 17,053
  • 1
  • 23
  • 44
Nocklas
  • 1,367
  • 4
  • 15
  • 27
  • Are you trying to stop the query as it is running or catch the promise and then decide whether to hit the function after the promise is returned? – PW Kad Jun 20 '13 at 16:24

1 Answers1

1

Update 16 May 2014

You can set HTTP-level timeout and cancellation with the AJAX Adapter's requestInterceptor as of v.1.4.12. See the documentation, "Controlling AJAX calls".

Original answer

Breeze uses Q for it's promises support. There has been some discussion on the concept of cancellable promises here: Q Cancellation. When Q supports this, then Breeze will as well.

Community
  • 1
  • 1
Jay Traband
  • 17,053
  • 1
  • 23
  • 44