阶段七:完成 React Feature 化与前置重构收口
This commit is contained in:
1 parent
375e84d663
commit
1a228dc35c
305 files changed
+14179
-5431
No files matched your search
@@ -0,0 +1,13 @@
|
||||
// commitIfLatest 仅在请求仍为最新时提交结果。
|
||||
export const commitIfLatest = <T>(
|
||||
requestID: number,
|
||||
currentRequestID: number,
|
||||
requestKey: string,
|
||||
currentKey: string,
|
||||
value: T,
|
||||
commit: (value: T) => void,
|
||||
): boolean => {
|
||||
if (requestID !== currentRequestID || requestKey !== currentKey) return false;
|
||||
commit(value);
|
||||
return true;
|
||||
};
|
||||
Reference in new issue
Block a user