Socket
Socket
Sign inDemoInstall

flue3

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flue3 - npm Package Compare versions

Comparing version 0.0.6-dev.0 to 0.0.7-dev.0

lib/types/AppMiddleware.d.ts

2

lib/app/composables/useFetch.d.ts

@@ -6,3 +6,3 @@ import { ComputedRef, Ref } from 'vue';

interface FetchOptions<T> {
serverPrefetch?: boolean;
lazy?: boolean;
initialFetch?: boolean;

@@ -9,0 +9,0 @@ initialValue?: () => T;

@@ -7,3 +7,3 @@ import { computed, toRef, reactive, watch, toRaw, onMounted, } from 'vue';

export function useFetch(key, hook, options) {
const serverPrefetch = options?.serverPrefetch ?? true;
const isLazy = options?.lazy ?? false;
const initialFetch = options?.initialFetch ?? true;

@@ -20,3 +20,3 @@ const initialValue = options?.initialValue;

if (appContext.isClient) {
if (serverPrefetch && appContext.state.hasOwnProperty(fetchKey)) {
if (!isLazy && appContext.state.hasOwnProperty(fetchKey)) {
initialState = appContext.state[fetchKey];

@@ -72,20 +72,18 @@ appContext.deleteState(fetchKey);

if (initialFetch) {
return new Promise(async (resolve) => {
if (appContext.isServer && serverPrefetch) {
if (isLazy) {
onMounted(async () => {
await load();
}
if (appContext.isClient && !fetchState.serverPrefetched) {
if (FLUE3_SSR_ENABLED) {
onMounted(async () => {
await load();
});
}
else {
});
}
else {
return new Promise(async (resolve) => {
if ((appContext.isServer && !isLazy)
|| (appContext.isClient && !fetchState.serverPrefetched)) {
await load();
}
}
resolve(returns);
});
resolve(returns);
});
}
}
return returns;
}
import { useFetch } from './useFetch.js';
export const useLazyFetch = (key, hook, options) => {
return useFetch(key, hook, {
initialFetch: false,
lazy: true,
...(options ?? {}),
});
};
import { AppContext } from '../types/AppContext.js';
export declare const defineMiddleware: (middleware: (appContext: AppContext) => Promise<void> | void) => (appContext: AppContext) => void | Promise<void>;
import { AppMiddleware } from '../types/AppMiddleware.js';
export declare const defineMiddleware: (middleware: AppMiddleware) => (appContext: AppContext) => void | Promise<void>;
{
"name": "flue3",
"version": "0.0.6-dev.0",
"version": "0.0.7-dev.0",
"description": "flue3 SSR framework based on Vite",

@@ -5,0 +5,0 @@ "author": "FL3NKEY",

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