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 Apr 2, 2024
1 parent 505a5b6 commit cf020f4
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 @@ -101,7 +101,7 @@ export const cancel = (eventType?: string) => calculator?.cancel(eventType);
* 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 @@ -112,4 +112,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 cf020f4

Please sign in to comment.