mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 09:04:07 -08:00
b50d8058cf
## Summary Required as part of NodeView refactoring: - Migrates `pinData` mixin to `usePinnedData` composable. - Adds `useActiveNode` and `useNodeType` composables ## Related tickets and issues https://linear.app/n8n/issue/N8N-6355/pindata ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created. - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
18 lines
386 B
TypeScript
18 lines
386 B
TypeScript
import { storeToRefs } from 'pinia';
|
|
import { useNDVStore } from '@/stores/ndv.store';
|
|
import { useNodeType } from '@/composables/useNodeType';
|
|
|
|
export function useActiveNode() {
|
|
const ndvStore = useNDVStore();
|
|
|
|
const { activeNode } = storeToRefs(ndvStore);
|
|
const { nodeType: activeNodeType } = useNodeType({
|
|
node: activeNode,
|
|
});
|
|
|
|
return {
|
|
activeNode,
|
|
activeNodeType,
|
|
};
|
|
}
|