first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
define(["require", "exports", "@fluentui/utilities", "react"], function (require, exports, utilities_1, React) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useAsync = useAsync;
/**
* Hook to provide an Async instance that is automatically cleaned up on dismount.
*/
function useAsync() {
var asyncRef = React.useRef(undefined);
if (!asyncRef.current) {
asyncRef.current = new utilities_1.Async();
}
React.useEffect(function () {
return function () {
var _a;
(_a = asyncRef.current) === null || _a === void 0 ? void 0 : _a.dispose();
asyncRef.current = undefined;
};
}, []);
return asyncRef.current;
}
});
//# sourceMappingURL=useAsync.js.map