Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastkit/vue-utils

Package Overview
Dependencies
Maintainers
1
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastkit/vue-utils - npm Package Compare versions

Comparing version 0.6.28 to 0.6.30

28

dist/vue-utils.cjs.js

@@ -740,2 +740,30 @@ 'use strict';

}
watchRoute(cb, options) {
let stoped = false;
let autoStop = options && options.autoStop;
if (autoStop == null) {
autoStop = true;
}
const stopHandle = vue.watch(this.router.currentRoute, (currentRoute, oldValue, onInvalidate) => {
if (stoped)
return;
if (autoStop) {
vue.nextTick(() => {
if (stoped)
return;
cb(currentRoute, oldValue, onInvalidate);
});
}
else {
cb(currentRoute, oldValue, onInvalidate);
}
}, options);
if (autoStop) {
vue.onBeforeUnmount(() => {
stoped = true;
stopHandle();
});
}
return stopHandle;
}
get transitioningTo() {

@@ -742,0 +770,0 @@ return this.state.transitioningTo;

@@ -740,2 +740,30 @@ 'use strict';

}
watchRoute(cb, options) {
let stoped = false;
let autoStop = options && options.autoStop;
if (autoStop == null) {
autoStop = true;
}
const stopHandle = vue.watch(this.router.currentRoute, (currentRoute, oldValue, onInvalidate) => {
if (stoped)
return;
if (autoStop) {
vue.nextTick(() => {
if (stoped)
return;
cb(currentRoute, oldValue, onInvalidate);
});
}
else {
cb(currentRoute, oldValue, onInvalidate);
}
}, options);
if (autoStop) {
vue.onBeforeUnmount(() => {
stoped = true;
stopHandle();
});
}
return stopHandle;
}
get transitioningTo() {

@@ -742,0 +770,0 @@ return this.state.transitioningTo;

8

dist/vue-utils.d.ts

@@ -28,3 +28,3 @@ import { BaseTransitionProps } from 'vue';

import type { RouteLocationNormalized } from 'vue-router';
import { RouteLocationNormalizedLoaded } from 'vue-router';
import type { RouteLocationNormalizedLoaded } from 'vue-router';
import { RouteLocationRaw } from 'vue-router';

@@ -45,2 +45,5 @@ import type { Router } from 'vue-router';

import type { VNodeTypes } from '@vue/runtime-core';
import { WatchCallback } from 'vue';
import { WatchOptions } from 'vue';
import { WatchStopHandle } from 'vue';

@@ -200,2 +203,5 @@ export declare const BODY_SCROLL_LOCK_ATTRIBUTE = "data-body-scroll-lock";

get currentRoute(): RouteLocationNormalizedLoaded;
watchRoute<Immediate extends Readonly<boolean> = false>(cb: WatchCallback<RouteLocationNormalizedLoaded, Immediate extends true ? RouteLocationNormalizedLoaded | undefined : RouteLocationNormalizedLoaded>, options?: WatchOptions<Immediate> & {
autoStop?: boolean;
}): WatchStopHandle;
get transitioningTo(): _RouteLocationBase | null;

@@ -202,0 +208,0 @@ get transitioning(): LocationTransitioning | null;

@@ -1,2 +0,2 @@

import { Comment, Text, computed, BaseTransition, h, Transition, onBeforeMount, onBeforeUnmount, reactive } from 'vue';
import { Comment, Text, computed, BaseTransition, h, Transition, onBeforeMount, onBeforeUnmount, reactive, watch, nextTick } from 'vue';
import { RouterLink } from 'vue-router';

@@ -736,2 +736,30 @@ import { isObjectEqual, IN_WINDOW, addTransitionendEvent, pushDynamicStyle, debounce } from '@fastkit/helpers';

}
watchRoute(cb, options) {
let stoped = false;
let autoStop = options && options.autoStop;
if (autoStop == null) {
autoStop = true;
}
const stopHandle = watch(this.router.currentRoute, (currentRoute, oldValue, onInvalidate) => {
if (stoped)
return;
if (autoStop) {
nextTick(() => {
if (stoped)
return;
cb(currentRoute, oldValue, onInvalidate);
});
}
else {
cb(currentRoute, oldValue, onInvalidate);
}
}, options);
if (autoStop) {
onBeforeUnmount(() => {
stoped = true;
stopHandle();
});
}
return stopHandle;
}
get transitioningTo() {

@@ -738,0 +766,0 @@ return this.state.transitioningTo;

10

package.json
{
"name": "@fastkit/vue-utils",
"version": "0.6.28",
"version": "0.6.30",
"description": "@fastkit/vue-utils",

@@ -34,7 +34,7 @@ "buildOptions": {

"dependencies": {
"@fastkit/body-scroll-lock": "0.6.28",
"@fastkit/visibility": "0.6.28",
"@fastkit/keybord": "0.6.28",
"@fastkit/helpers": "0.6.28"
"@fastkit/body-scroll-lock": "0.6.30",
"@fastkit/visibility": "0.6.30",
"@fastkit/keybord": "0.6.30",
"@fastkit/helpers": "0.6.30"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc