@coin-voyage/paykit
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
21 lines • 647 B
JavaScript
import { useEffect, useState } from "react";
import { useConfig } from "wagmi";
export const useLastConnector = () => {
const { storage } = useConfig();
const [lastConnectorId, setLastConnectorId] = useState(null);
useEffect(() => {
const init = async () => {
const id = await storage?.getItem("recentConnectorId");
setLastConnectorId(id ?? "");
};
init();
}, []);
const update = (id) => {
storage?.setItem("recentConnectorId", id);
};
return {
lastConnectorId,
updateLastConnectorId: update,
};
};
//# sourceMappingURL=useLastConnector.js.map