MCPcopy Create free account
hub / github.com/microsoft/SandDance / useAsync

Function useAsync

docs/app/js/sanddance-app.js:34499–34512  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34497var _react = require("react");
34498var _useConst = require("./useConst");
34499function useAsync() {
34500 var async = (0, _useConst.useConst)(function() {
34501 return new (0, _utilities.Async)();
34502 });
34503 // Function that returns a function in order to dispose the async instance on unmount
34504 _react.useEffect(function() {
34505 return function() {
34506 return async.dispose();
34507 };
34508 }, [
34509 async
34510 ]);
34511 return async;
34512}
34513
34514},{"@uifabric/utilities":"uTCgd","react":"8ePka","./useConst":"jDC9C","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"jDC9C":[function(require,module,exports) {
34515var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected