Download client/modules/logEntries.ts from abhijeetsarkargis/MiniSearch: direct link, hf CLI and curl.
- Browser
- Download file 406 Bytes
-
https://huggingface.co/spaces/abhijeetsarkargis/MiniSearch/resolve/main/client/modules/logEntries.ts
- Command line
-
hf download hf://spaces/abhijeetsarkargis/MiniSearch/client/modules/logEntries.ts
-
curl -L -o logEntries.ts https://huggingface.co/spaces/abhijeetsarkargis/MiniSearch/resolve/main/client/modules/logEntries.ts
406 Bytes
| import { createPubSub } from "create-pubsub"; | |
| type LogEntry = { | |
| timestamp: string; | |
| message: string; | |
| }; | |
| export const logEntriesPubSub = createPubSub<LogEntry[]>([]); | |
| const [updateLogEntries, , getLogEntries] = logEntriesPubSub; | |
| export function addLogEntry(message: string) { | |
| updateLogEntries([ | |
| ...getLogEntries(), | |
| { | |
| timestamp: new Date().toISOString(), | |
| message, | |
| }, | |
| ]); | |
| } | |