import { act, render } from "@testing-library/react";
import React, { useState } from "react";
import { createLifecycleUtils } from "../shared/testing/lifecycle";
import { ScopeProvider, createScope, molecule, use, useMolecule } from "./";
const TestCope = createScope<{ number?: number }>({});
const lifecycle = createLifecycleUtils();
const TestMol = molecule(() => {
const scope = use(TestCope);
// console.log(scope.number); //In the first case, there is no change, and in the second case, the value from one timing ago is output.
lifecycle.connect(scope.number);
return { scope };
});
const useTestMol = () => {
const mol = useMolecule(TestMol);
const number = mol.scope.number;
return { number };
};
const Test = () => {
const { number } = useTestMol();
return