当前位置: 首页>>代码示例>>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;未经允许,请勿转载。