Skip to content

Commit 4c8165b

Browse files
committed
chore: Implement updateHash
1 parent 2559070 commit 4c8165b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/dependency.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/* eslint-disable max-classes-per-file */
22

33
import { ReplaceSource } from "webpack-sources";
4-
import * as docGen from "react-docgen-typescript";
54

65
// eslint-disable-next-line
76
// @ts-ignore: What's the right way to refer to this one?
8-
import Module from "webpack/lib/Module.js";
7+
import Hash from "webpack/lib/util/Hash.js";
98

109
// eslint-disable-next-line
1110
// @ts-ignore: What's the right way to refer to this one?
@@ -25,7 +24,9 @@ class DocGenDependency extends NullDependency {
2524
this.codeBlock = codeBlock;
2625
}
2726

28-
// TODO: Note if you want that modules correctly invalidate and cache you need to add updateHash to your Dependency and hash the type info (because that might change depending on outside factors (other modules)
27+
updateHash(hash: Hash): void {
28+
hash.update(this.codeBlock);
29+
}
2930
}
3031

3132
makeSerializable(

0 commit comments

Comments
 (0)