當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript browser.configureScope函數代碼示例

本文整理匯總了TypeScript中@sentry/browser.configureScope函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript configureScope函數的具體用法?TypeScript configureScope怎麽用?TypeScript configureScope使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了configureScope函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: switchMap

 switchMap(user => {
     if (user) {
         Sentry.configureScope((scope) => {
             scope.setUser({ 'email': user.email });
         });
         return this.afs.doc<User>(`users/${user.uid}`).valueChanges();
     } else {
         return of(null);
     }
 }),
開發者ID:jacobbowdoin,項目名稱:RapidWords,代碼行數:10,代碼來源:auth.service.ts

示例2: init

(() => {

  // Desativa o plugin em localhost
  if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') {
    return;
  }

  const { REACT_APP_SENTRY_DSN, REACT_APP_VERSION, REACT_APP_NODE_ENV } = process.env;
  if (!REACT_APP_SENTRY_DSN) {
    return;
  }

  init({ dsn: REACT_APP_SENTRY_DSN, release: REACT_APP_VERSION, environment: REACT_APP_NODE_ENV });
  configureScope(scope => {
  });

})();
開發者ID:juninmd,項目名稱:fatec-hospital-web,代碼行數:17,代碼來源:sentry.plugin.ts

示例3: next

const ravenMiddleware: Middleware<{}, State> = (store) => {
  Sentry.configureScope((scope) => {
    scope.addEventProcessor((event) =>
      produce(event, (draft) => {
        draft.extra!['redux:state'] = stateTransformer(store.getState());
      }),
    );
  });

  return (next) => (action) => {
    Sentry.addBreadcrumb({
      category: 'redux-action',
      message: action.type,
    });

    return next(action);
  };
};
開發者ID:nusmodifications,項目名稱:nusmods,代碼行數:18,代碼來源:raven-middleware.ts

示例4: canUseBrowserLocalStorage

const browserCanUseLocalStorage = canUseBrowserLocalStorage();
const isBrowserSupported =
  bowser.check(
    {
      msedge: '14',
      chrome: '56',
      firefox: '52',
      safari: '10',
    },
    true,
  ) ||
  (bowser.ios && parseFloat(bowser.osversion));

// Add unsupported tag so that we can filter out reports from those users
Sentry.configureScope((scope) => {
  scope.setTag('unsupported', String(!isBrowserSupported));
});

if (!isBrowserSupported) {
  // Show unsupported browser warning
  if (
    (browserCanUseLocalStorage && !localStorage.getItem(BROWSER_WARNING_KEY)) ||
    !browserCanUseLocalStorage
  ) {
    const promptText = (() => {
      // Users can only update Safari by updating the OS in iOS
      if (bowser.ios)
        return `NUSMods may not work properly. Please consider updating your device to iOS 11 or higher.`;
      if (bowser.android && bowser.chrome)
        return `NUSMods may not work properly. Please consider ${linkForChromePlayStore}.`;
      return `NUSMods may not work properly. Please consider updating your web browser or switching to the latest version of ${linkForChrome} or ${linkForFirefox}.`;
開發者ID:nusmodifications,項目名稱:nusmods,代碼行數:31,代碼來源:browser.ts


注:本文中的@sentry/browser.configureScope函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。