1.0.5 • Published 1 month ago

@ti-platform/aide-vueuse v1.0.5

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

@ti-platform/aide-vueuse

This package contains utility functions that makes use @vueuse/core and its functions.

Contents

API Docs

Enumerations

PollingState

The state of the polling.

Enumeration Members

Enumeration MemberValue
FAILURE3
NOT_STARTED0
POLLING1
SUCCESS2
TIMEOUT4

Type Aliases

ElementOrComponentWithEl

ElementOrComponentWithEl: HTMLElement | Object

Either an HTMLElement or a Vue component with the property $el which is an HTMLElement.

Source

dom.ts:8


UsePollingRetVal

UsePollingRetVal: Object

Return value of the usePolling function.

Type declaration

MemberTypeDescription
startPolling() => UsePollingRetValStart polling.
stateComputedRef<PollingState>The current state of the polling.

Source

polling.ts:21

Functions

isPollingFailure()

isPollingFailure(state): boolean

See if the given state is considered a failure, either it was considered a failure by the executing function or it had timed out.

Parameters

ParameterTypeDescription
statePollingStateThe state to validate.

Returns

boolean

Returns true if it is considered to be a failure, false otherwise.

Source

polling.ts:40


useHeightCalc()

useHeightCalc(baseHeight, elements): ComputedRefWithControl<string>

In cases where we have an element where any of the height CSS styles is using the "calc" function, we may want to subtract from a base height the current height of some elements, this function allows for that.

Parameters

ParameterTypeDescription
baseHeightstringThe base height to essentially subtract from. Ex: 90vh, 800px, 100%
elementsRef<ElementOrComponentWithEl>[]The list of elements or components with a singular root element whose height we will subtract from.

Returns

ComputedRefWithControl<string>

Source

dom.ts:17


usePolling()

usePolling(fn, intervalMs, timeoutMs): UsePollingRetVal

Keep executing the provided function until it returns a success, failure, or it has timed out. Note that the next polling will not start until the current task finishes.

Parameters

ParameterTypeDescription
fn() => Awaitable<PollingState>The function to execute. The function should return PollingState.POLLING to have the polling to continue. Returning either PollingState.SUCCESS or PollingState.FAILURE will stop polling.
intervalMsnumberThe time in milliseconds between each poll.
timeoutMsnumberThe maximum time in milliseconds before it is considered a polling timeout.

Returns

UsePollingRetVal

Return an object with the current state of the polling and function to start the polling.

Source

polling.ts:54

1.0.5

1 month ago

1.0.4

1 month ago

1.0.3

1 month ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.0.7

10 months ago

0.0.6

11 months ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

2 years ago