@bemedev/app-react
Version:
Use app-ts inside react
12 lines (11 loc) • 319 B
JavaScript
import { dequal } from "dequal";
//#region src/utils/getSnapshot.ts
function getSnapshot(service, ref) {
const snapShot = service.state;
if (dequal(snapShot, ref.current)) return ref.current;
ref.current = snapShot;
return ref.current;
}
//#endregion
export { getSnapshot };
//# sourceMappingURL=getSnapshot.js.map