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


TypeScript ExploreUpdateState.default方法代碼示例

本文整理匯總了TypeScript中app/types/explore.ExploreUpdateState.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ExploreUpdateState.default方法的具體用法?TypeScript ExploreUpdateState.default怎麽用?TypeScript ExploreUpdateState.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app/types/explore.ExploreUpdateState的用法示例。


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

示例1: makeInitialUpdateState

export const makeExploreItemState = (): ExploreItemState => ({
  StartPage: undefined,
  containerWidth: 0,
  datasourceInstance: null,
  requestedDatasourceName: null,
  datasourceError: null,
  datasourceLoading: null,
  datasourceMissing: false,
  exploreDatasources: [],
  history: [],
  queries: [],
  initialized: false,
  queryIntervals: { interval: '15s', intervalMs: DEFAULT_GRAPH_INTERVAL },
  range: {
    from: null,
    to: null,
    raw: DEFAULT_RANGE,
  },
  scanning: false,
  scanRange: null,
  showingGraph: true,
  showingTable: true,
  graphIsLoading: false,
  logIsLoading: false,
  tableIsLoading: false,
  queryKeys: [],
  urlState: null,
  update: makeInitialUpdateState(),
  queryErrors: [],
  latency: 0,
  supportedModes: [],
  mode: null,
  isLive: false,
});
開發者ID:grafana,項目名稱:grafana,代碼行數:34,代碼來源:reducers.ts

示例2: calculateResultsFromQueryTransactions

    mapper: (state, action): ExploreItemState => {
      const { queryIntervals, refreshInterval } = state;
      const { result, resultType, latency } = action.payload;
      const results = calculateResultsFromQueryTransactions(result, resultType, queryIntervals.intervalMs);
      const live = isLive(refreshInterval);

      if (live) {
        return state;
      }

      return {
        ...state,
        graphResult: resultType === 'Graph' ? results.graphResult : state.graphResult,
        tableResult: resultType === 'Table' ? results.tableResult : state.tableResult,
        logsResult:
          resultType === 'Logs'
            ? sortLogsResult(results.logsResult, refreshInterval)
            : sortLogsResult(state.logsResult, refreshInterval),
        latency,
        graphIsLoading: live ? true : false,
        logIsLoading: live ? true : false,
        tableIsLoading: live ? true : false,
        showingStartPage: false,
        update: makeInitialUpdateState(),
      };
    },
開發者ID:grafana,項目名稱:grafana,代碼行數:26,代碼來源:reducers.ts

示例3: makeInitialUpdateState

 mapper: (state, action): ExploreItemState => {
   const { queryTransactions } = action.payload;
   return {
     ...state,
     queryTransactions,
     showingStartPage: false,
     update: makeInitialUpdateState(),
   };
 },
開發者ID:johntdyer,項目名稱:grafana,代碼行數:9,代碼來源:reducers.ts

示例4: sortLogsResult

    mapper: (state): ExploreItemState => {
      const logsResult = sortLogsResult(state.logsResult, state.refreshInterval);

      return {
        ...state,
        logsResult,
        graphIsLoading: true,
        logIsLoading: true,
        tableIsLoading: true,
        showingStartPage: false,
        update: makeInitialUpdateState(),
      };
    },
開發者ID:grafana,項目名稱:grafana,代碼行數:13,代碼來源:reducers.ts


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