Implements a dependency injection pattern to break circular dependencies
between the token operations and token refresh modules. Allows the
token-refresh module to provide its scheduling function without
creating a direct import dependency.
This approach maintains separation of concerns while enabling proper
coordination between token storage and token refresh scheduling.
Parameters
fn: (expiresIn:number)=>void
The function to schedule token refresh
Returns void
Example
// In token-refresh.ts import { setScheduleTokenRefreshFunction } from"./token-operations";
Sets the function to schedule token refresh
Implements a dependency injection pattern to break circular dependencies between the token operations and token refresh modules. Allows the token-refresh module to provide its scheduling function without creating a direct import dependency.
This approach maintains separation of concerns while enabling proper coordination between token storage and token refresh scheduling.