From 99ea8e538129a874d788f5a07b5fd1f31880c2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 10 Jun 2019 19:45:31 +0800 Subject: [PATCH] prettier all code --- scripts/fetch-blocks.js | 4 +--- src/models/global.ts | 12 +++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/fetch-blocks.js b/scripts/fetch-blocks.js index d6b27c1c..9e182b75 100644 --- a/scripts/fetch-blocks.js +++ b/scripts/fetch-blocks.js @@ -94,9 +94,7 @@ const installBlock = async () => { console.log('install ' + chalk.green(item.name) + ' to: ' + chalk.yellow(item.path)); gitFiles = gitFiles.filter(file => file.path !== gitPath); const skipModifyRouter = item.routes ? '--skip-modify-routes' : ''; - const cmd = `umi block add https://github.com/ant-design/pro-blocks/tree/master/${gitPath} --path=${ - item.path - } ${skipModifyRouter}`; + const cmd = `umi block add https://github.com/ant-design/pro-blocks/tree/master/${gitPath} --path=${item.path} ${skipModifyRouter}`; try { await execCmd(cmd); console.log(`install ${chalk.hex('#1890ff')(item.name)} success`); diff --git a/src/models/global.ts b/src/models/global.ts index 02a61a45..df3e6e69 100644 --- a/src/models/global.ts +++ b/src/models/global.ts @@ -124,13 +124,11 @@ const GlobalModel: GlobalModelType = { subscriptions: { setup({ history }): void { // Subscribe history(url) change, trigger `load` action if pathname is `/` - history.listen( - ({ pathname, search }): void => { - if (typeof (window as any).ga !== 'undefined') { - (window as any).ga('send', 'pageview', pathname + search); - } - }, - ); + history.listen(({ pathname, search }): void => { + if (typeof (window as any).ga !== 'undefined') { + (window as any).ga('send', 'pageview', pathname + search); + } + }); }, }, };