npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ti-platform/aide-vue

v2.0.8

Published

This package contains utility functions that can be used with Vue to enhance the development of Vue components.

Downloads

32

Readme

@ti-platform/aide-vue

This package contains utility functions that can be used with Vue to enhance the development of Vue components.

Contents

API Docs

Type Aliases

ReactiveExecuteTasksRet<T>

ReactiveExecuteTasksRet<T>: {activeWorkers: Readonly<Ref<number>>;completedTasks: Readonly<Ref<number>>;isAllTasksCompleted: Readonly<Ref<boolean>>;results: Readonly<Ref<T[]>>;totalTasks: Readonly<Ref<number>>; }

The return value for the function reactiveExecuteTasks.

Type Parameters

| Type Parameter | Description | | -------------- | ----------------------- | | T | The type of the result. |

Type declaration

| Name | Type | Description | | --------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | activeWorkers | Readonly<Ref<number>> | The current active number of workers. | | completedTasks | Readonly<Ref<number>> | The current number of completed tasks. | | isAllTasksCompleted | Readonly<Ref<boolean>> | True if all the tasks have completed running, false otherwise. | | results | Readonly<Ref<T[]>> | The array storing the results as it is returned. Note that this can be a sparsed array with missing indexes as it is filled with the results only when it is available. You should check for undefined before using it. | | totalTasks | Readonly<Ref<number>> | The total number of tasks that was queued. |

Defined in

queue.ts:10


ValueTypes

ValueTypes: string | number | string[] | number[]

Defined in

validators.ts:3

Functions

asComputed()

asComputed<T>(ref): ComputedRef<T>

Shorthand method to simply convert a Ref to a ComputedRef.

Type Parameters

| Type Parameter | | -------------- | | T |

Parameters

| Parameter | Type | Description | | --------- | ---------- | ------------------- | | ref | Ref<T> | The Ref to convert. |

Returns

ComputedRef<T>

The ComputedRef that simply returns the value of the given Ref.

Defined in

reactivity.ts:10


injectRefs()

injectRefs<T>(key): ToRefs<NonNullable<T>>

Inject the data from the provided key (we are assuming the data exists) and return the results as refs.

Type Parameters

| Type Parameter | | -------------- | | T |

Parameters

| Parameter | Type | Description | | --------- | ------------------- | --------------------------------------- | | key | InjectionKey<T> | The key to retrieve the data to inject. |

Returns

ToRefs<NonNullable<T>>

Defined in

data.ts:10


isRequiredField()

isRequiredField(invalidMessage): (value) => string | true

Given a field, make sure it is not empty. If it is, return a proper error message. This validator is meant to be used with QForm.

Parameters

| Parameter | Type | Default value | Description | | ---------------- | -------- | ---------------------------------- | ------------------------------------------- | | invalidMessage | string | DEFAULT_REQUIRED_INVALID_MESSAGE | The message to show when validation failed. |

Returns

Function

Parameters

| Parameter | Type | | --------- | ------------------------------------ | | value | ValueTypes |

Returns

string | true

Defined in

validators.ts:14


isRequiredFieldWhen()

isRequiredFieldWhen(when, invalidMessage): (value) => string | true

Returns a function that before checking to see if a required field is filled out, validate against some other condition.

Parameters

| Parameter | Type | Default value | Description | | ---------------- | --------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | when | () => boolean | undefined | Function to execute to see if the required validation field is necessary. It should return true when the field is required, false otherwise. | | invalidMessage | string | DEFAULT_REQUIRED_INVALID_MESSAGE | The message to show when validation failed. |

Returns

Function

Parameters

| Parameter | Type | | --------- | ------------------------------------ | | value | ValueTypes |

Returns

string | true

Defined in

validators.ts:26


isUniqueField()

isUniqueField(existingValues, invalidMessage): (value) => string | true

Given a reference to a list of values, check when a value is given that it isn't in the list twice.

Parameters

| Parameter | Type | Default value | Description | | ---------------- | -------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------- | | existingValues | Ref<(string | number)[]> | undefined | A reference to the list of existing values. The list should update when new values are added. | | invalidMessage | string | DEFAULT_UNIQUE_INVALID_MESSAGE | The message to show when validation failed. |

Returns

Function

Parameters

| Parameter | Type | | --------- | -------------------- | | value | string | number |

Returns

string | true

Defined in

validators.ts:38


provideAndReturnRefs()

provideAndReturnRefs<T>(key, data): ToRefs<UnwrapNestedRefs<T>>

Provide the given data to child components and return the data as refs.

Type Parameters

| Type Parameter | | ---------------------- | | T extends object |

Parameters

| Parameter | Type | Description | | --------- | ------------------- | ----------------------------- | | key | InjectionKey<T> | The key to store the data as. | | data | T | The data to store. |

Returns

ToRefs<UnwrapNestedRefs<T>>

Defined in

data.ts:22


reactiveExecuteTasks()

reactiveExecuteTasks<T>(tasks, maxNumOfWorkers): ReactiveExecuteTasksRet<T>

Reactive version of @ti-platform/aide#xecuteTasks.

Type Parameters

| Type Parameter | Description | | -------------- | ------------------------------------ | | T | The type of the result of each task. |

Parameters

| Parameter | Type | Default value | Description | | ----------------- | -------------------------------- | ------------- | ------------------------------------------- | | tasks | readonly () => Promise<T>[] | undefined | The tasks to run. | | maxNumOfWorkers | number | 10 | The maximum number of tasks ot run at once. |

Returns

ReactiveExecuteTasksRet<T>

Defined in

queue.ts:45