@vue-composable/core
Advanced tools
Comparing version 1.0.0-dev.14 to 1.0.0-dev.15
@@ -383,2 +383,8 @@ 'use strict'; | ||
/** | ||
* Create `debounced` function, options object can be changed after creation to update behaviour | ||
* @param handler - function to be debounced | ||
* @param wait - debounce ms | ||
* @param options - debounce options | ||
*/ | ||
function useDebounce(handler, wait, options) { | ||
@@ -410,2 +416,6 @@ return debounce(handler, wait, options); | ||
/** | ||
* Reactive custom timer with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function useNow(options) { | ||
@@ -447,2 +457,6 @@ const SYNC_MS = 1000; | ||
/** | ||
* Reactive `Date.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function useDateNow(options) { | ||
@@ -458,2 +472,6 @@ const refreshMs = (options && options.refreshMs) || 1000; | ||
/** | ||
* Reactive `performance.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function usePerformanceNow(options) { | ||
@@ -723,3 +741,3 @@ const refreshMs = (options && options.refreshMs) || 1000; | ||
if (shouldFallback) { | ||
const fallbackI18n = loadLocale(locale.value, localeMessages); | ||
const fallbackI18n = loadLocale(definition.fallback, localeMessages); | ||
if (isPromise(fallbackI18n)) { | ||
@@ -726,0 +744,0 @@ fallbackI18n.then(x => { |
@@ -371,2 +371,8 @@ 'use strict'; | ||
/** | ||
* Create `debounced` function, options object can be changed after creation to update behaviour | ||
* @param handler - function to be debounced | ||
* @param wait - debounce ms | ||
* @param options - debounce options | ||
*/ | ||
function useDebounce(handler, wait, options) { | ||
@@ -398,2 +404,6 @@ return debounce(handler, wait, options); | ||
/** | ||
* Reactive custom timer with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function useNow(options) { | ||
@@ -429,2 +439,6 @@ const SYNC_MS = 1000; | ||
/** | ||
* Reactive `Date.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function useDateNow(options) { | ||
@@ -440,2 +454,6 @@ const refreshMs = (options && options.refreshMs) || 1000; | ||
/** | ||
* Reactive `performance.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function usePerformanceNow(options) { | ||
@@ -702,3 +720,3 @@ const refreshMs = (options && options.refreshMs) || 1000; | ||
if (shouldFallback) { | ||
const fallbackI18n = loadLocale(locale.value, localeMessages); | ||
const fallbackI18n = loadLocale(definition.fallback, localeMessages); | ||
if (isPromise(fallbackI18n)) { | ||
@@ -705,0 +723,0 @@ fallbackI18n.then(x => { |
@@ -106,7 +106,9 @@ import { Ref } from '@vue/composition-api'; | ||
/** | ||
* @description - interval in ms | ||
* Refresh rate in milliseconds that the now gets updated | ||
* @default 1000 | ||
*/ | ||
refreshMs?: number; | ||
/** | ||
* @description - sync with seconds the clock | ||
* Sync with the clock by the second | ||
* @default true | ||
*/ | ||
@@ -117,2 +119,5 @@ sync?: boolean; | ||
export declare type Options = { | ||
/** | ||
* calls debounce immediately | ||
*/ | ||
isImmediate: boolean; | ||
@@ -267,2 +272,6 @@ }; | ||
/** | ||
* Reactive `Date.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
export declare function useDateNow(options?: NowOptions): { | ||
@@ -273,3 +282,9 @@ now: import("@vue/composition-api").Ref<number>; | ||
export declare function useDebounce<T extends Function>(handler: T, wait?: number, options?: Options): T; | ||
/** | ||
* Create `debounced` function, options object can be changed after creation to update behaviour | ||
* @param handler - function to be debounced | ||
* @param wait - debounce ms | ||
* @param options - debounce options | ||
*/ | ||
export declare function useDebounce<T extends Procedure>(handler: T, wait?: number, options?: Options): T; | ||
@@ -286,2 +301,6 @@ export declare function useFormat(format: Readonly<RefTyped<string>>, obj?: RefTyped<FormatObject>): Readonly<Ref<string>>; | ||
/** | ||
* Reactive custom timer with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
export declare function useNow(options?: NowOptions & UseNowOptions): { | ||
@@ -294,3 +313,9 @@ now: import("@vue/composition-api").Ref<number>; | ||
/** | ||
* @description - time factory, it should retrieve `now` in ms | ||
* Function called when refresh the date | ||
* * @example | ||
* ```ts | ||
* () => Date.now() | ||
* // or | ||
* () => performance.now() | ||
* ``` | ||
*/ | ||
@@ -302,6 +327,10 @@ timeFn?: () => number; | ||
export declare function usePath<T extends object = any>(source: RefTyped<T>, path: RefTyped<string>, separator?: string, notFoundReturn?: UsePathNotFoundReturn): Readonly<import("@vue/composition-api").Ref<Readonly<any>>>; | ||
export declare function usePath<T = any>(source: RefTyped<object>, path: RefTyped<string>, separator?: string, notFoundReturn?: UsePathNotFoundReturn): Ref<Readonly<T>>; | ||
export declare type UsePathNotFoundReturn = (path: string, source: any, fullPath: string, originalSource: any) => any; | ||
/** | ||
* Reactive `performance.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
export declare function usePerformanceNow(options?: NowOptions): { | ||
@@ -308,0 +337,0 @@ now: import("@vue/composition-api").Ref<number>; |
@@ -379,2 +379,8 @@ import { isRef, ref, computed, watch, onUnmounted, reactive, inject, provide } from '@vue/composition-api'; | ||
/** | ||
* Create `debounced` function, options object can be changed after creation to update behaviour | ||
* @param handler - function to be debounced | ||
* @param wait - debounce ms | ||
* @param options - debounce options | ||
*/ | ||
function useDebounce(handler, wait, options) { | ||
@@ -406,2 +412,6 @@ return debounce(handler, wait, options); | ||
/** | ||
* Reactive custom timer with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function useNow(options) { | ||
@@ -443,2 +453,6 @@ const SYNC_MS = 1000; | ||
/** | ||
* Reactive `Date.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function useDateNow(options) { | ||
@@ -454,2 +468,6 @@ const refreshMs = (options && options.refreshMs) || 1000; | ||
/** | ||
* Reactive `performance.now()` with specified refresh rate | ||
* @param options - Configuration | ||
*/ | ||
function usePerformanceNow(options) { | ||
@@ -719,3 +737,3 @@ const refreshMs = (options && options.refreshMs) || 1000; | ||
if (shouldFallback) { | ||
const fallbackI18n = loadLocale(locale.value, localeMessages); | ||
const fallbackI18n = loadLocale(definition.fallback, localeMessages); | ||
if (isPromise(fallbackI18n)) { | ||
@@ -722,0 +740,0 @@ fallbackI18n.then(x => { |
{ | ||
"name": "@vue-composable/core", | ||
"version": "1.0.0-dev.14", | ||
"version": "1.0.0-dev.15", | ||
"description": "@vue-composable/core", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,2 +52,3 @@ # @vue-composable/core | ||
- [format][format] - Reactive string format | ||
- [path](https://pikax.me/vue-composable/composable/format/path) - Retrieve object value based on string path | ||
@@ -54,0 +55,0 @@ ## Promise |
101268
2741
90