refactor: change separate tools by category
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { getCurrentInstance, type ComponentInternalInstance } from 'vue';
|
||||
|
||||
/**
|
||||
* @name getLifeCycleTarger
|
||||
* @category Utils
|
||||
* @description Function to get the target instance of the lifecycle hook
|
||||
*
|
||||
* @param {ComponentInternalInstance} target The target instance of the lifecycle hook
|
||||
* @returns {ComponentInternalInstance | null} Instance of the lifecycle hook or null
|
||||
*
|
||||
* @example
|
||||
* const target = getLifeCycleTarger();
|
||||
*
|
||||
* @example
|
||||
* const target = getLifeCycleTarger(instance);
|
||||
*
|
||||
* @since 0.0.1
|
||||
*/
|
||||
export function getLifeCycleTarger(target?: ComponentInternalInstance) {
|
||||
return target || getCurrentInstance();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @name VueToolsError
|
||||
* @category Error
|
||||
* @description VueToolsError is a custom error class that represents an error in Vue Tools
|
||||
*
|
||||
* @since 0.0.1
|
||||
*/
|
||||
export class VueToolsError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = 'VueToolsError';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './components';
|
||||
export * from './error';
|
||||
Reference in New Issue
Block a user