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


TypeScript actions.updateModalWidgetParams方法代碼示例

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


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

示例1: async

          async ({ name, status, progress, eta, bps }) => {
            if (!prereqsModal) {
              return;
            }

            let state = {
              ...prereqsStateParams.tasks[name],
              status,
              progress,
              eta,
              bps,
            };

            let tasks = {
              ...prereqsStateParams.tasks,
              [name]: state,
            };

            prereqsStateParams = { ...prereqsStateParams, tasks };

            store.dispatch(
              actions.updateModalWidgetParams(
                modalWidgets.prereqsState.update({
                  id: prereqsModal.id,
                  widgetParams: prereqsStateParams,
                })
              )
            );
          }
開發者ID:HorrerGames,項目名稱:itch,代碼行數:29,代碼來源:perform-launch.ts

示例2:

 const update = () => {
   store.dispatch(
     actions.updateModalWidgetParams(
       modalWidgets.scanInstallLocations.update({
         id: modalId,
         widgetParams,
       })
     )
   );
 };
開發者ID:HorrerGames,項目名稱:itch,代碼行數:10,代碼來源:scan-install-locations.ts

示例3: async

  watcher.on(actions.manageGame, async (store, action) => {
    const { game } = action.payload;

    const { caves } = await call(messages.FetchCavesByGameID, {
      gameId: game.id,
    });

    const widgetParams = {
      game,
      caves,
      allUploads: [],
      loadingUploads: true,
    };

    const openModal = actions.openModal(
      modalWidgets.manageGame.make({
        window: "root",
        title: game.title,
        message: "",
        buttons: [
          {
            label: ["prompt.action.close"],
            className: "secondary",
          },
        ],
        widgetParams,
      })
    );
    store.dispatch(openModal);
    const modalId = openModal.payload.id;

    try {
      try {
        const { uploads } = await call(messages.GameFindUploads, { game });
        widgetParams.allUploads = uploads;
      } catch (e) {
        console.log(`Could not fetch compatible uploads: ${e.stack}`);
      }
    } catch (e) {
      logger.warn(`could not list uploads: ${e.message}`);
    } finally {
      widgetParams.loadingUploads = false;

      store.dispatch(
        actions.updateModalWidgetParams(
          modalWidgets.manageGame.update({
            id: modalId,
            widgetParams,
          })
        )
      );
    }
  });
開發者ID:HorrerGames,項目名稱:itch,代碼行數:53,代碼來源:manage-game.ts


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