@daimo/pay
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
25 lines (22 loc) • 619 B
JavaScript
import { useState, useEffect } from 'react';
import { useConfig } from 'wagmi';
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
};
};
export { useLastConnector };
//# sourceMappingURL=useLastConnector.js.map