Skip to content

Commit

Permalink
getNetworkIdleObservable should not be called on import
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Hyndman committed Sep 6, 2023
1 parent 860d5e2 commit c9924f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const cancel = () => calculator?.cancel();
* For the most accurate results, `decrementAjaxCount` should be called
* **exactly once** for each `incrementAjaxCount`.
*/
export const incrementAjaxCount = getNetworkIdleObservable().incrementAjaxCount;
export const incrementAjaxCount = () => getNetworkIdleObservable().incrementAjaxCount();

/**
* Call this to notify ttvc that an AJAX request has just resolved.
Expand All @@ -100,4 +100,4 @@ export const incrementAjaxCount = getNetworkIdleObservable().incrementAjaxCount;
* For the most accurate results, `decrementAjaxCount` should be called
* **exactly once** for each `incrementAjaxCount`.
*/
export const decrementAjaxCount = getNetworkIdleObservable().decrementAjaxCount;
export const decrementAjaxCount = () => getNetworkIdleObservable().decrementAjaxCount();

0 comments on commit c9924f0

Please sign in to comment.