Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
68 views
in Technique[技术] by (71.8m points)

javascript - TypeScript caching static object imported from file

The weirdest thing just occured to me. But caching issues are always scary...

  • In 1) I'm assigning defaultConfig to the variable config
  • In 2) you can see, that defaultConfig is imported from a file. That is the file in 3)
  • You see that the file in 3) contains a static object.
  • However, in 4) you see what the debugger shows. The app is having all kinds of items in that object. Those items are from the previous run.

So, to explain. On the first run, all is fine. But once you merged fields into the config what happens on the next run of that script is, that config holds all those fields initially.

What is causing that? And more importantly, how to end that mess?

enter image description here

question from:https://stackoverflow.com/questions/65870740/typescript-caching-static-object-imported-from-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...