migrating hooks, fixed colorMode
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { useStore } from '$lib/store';
|
||||
|
||||
import type { ConnectionState } from '@xyflow/system';
|
||||
|
||||
/**
|
||||
* Hook for receiving the current connection.
|
||||
*
|
||||
* @public
|
||||
* @returns current connection as a readable store
|
||||
*/
|
||||
export function useConnection(): { current: ConnectionState } {
|
||||
const { connection } = $derived(useStore());
|
||||
|
||||
return {
|
||||
get current() {
|
||||
return connection;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user