From 1ff82654cfa23ded9fb10ba5577fc50b2fdd61b7 Mon Sep 17 00:00:00 2001 From: dailyrandomphoto Date: Thu, 10 Oct 2019 10:34:21 +0800 Subject: [PATCH] Change to arrow function --- lib/plugins/helper/fragment_cache.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/plugins/helper/fragment_cache.js b/lib/plugins/helper/fragment_cache.js index b54468b372..6510b8de7b 100644 --- a/lib/plugins/helper/fragment_cache.js +++ b/lib/plugins/helper/fragment_cache.js @@ -3,10 +3,8 @@ module.exports = ctx => { let cache = {}; - ctx.on('generateBefore', function() { - // reset cache for watch mode - cache = {}; - }); + // reset cache for watch mode + ctx.on('generateBefore', () => { cache = {}; }); return function fragmentCache(id, fn) { if (this.cache && cache[id] != null) return cache[id];