UNPKG

@data-client/core

Version:

Async State Management without the Management. REST, GraphQL, SSE, Websockets, Fetch

14 lines (12 loc) 270 B
import type { ActionMeta } from '../../actions.js'; export function createMeta( expiryLength: number, fetchedAt?: number, ): ActionMeta { const now = Date.now(); return { fetchedAt: fetchedAt ?? now, date: now, expiresAt: now + expiryLength, }; }