logan-web
Version:
Web SDK for Logan, supports log and report in H5 and browser environment.
22 lines (18 loc) • 410 B
text/typescript
import Config from './global-config';
let logTryQuota: number = Config.get('logTryTimes') as number;
function errorTrigger (): void {
if (logTryQuota > 0) {
logTryQuota--;
}
}
function canSave (): boolean {
return logTryQuota > 0;
}
function resetQuota (): void {
logTryQuota = Config.get('logTryTimes') as number;
}
export default {
errorTrigger,
canSave,
resetQuota
};