mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-08 16:14:22 +01:00
Implement NStore interface from NLib
This commit is contained in:
6
src/utils/abort.ts
Normal file
6
src/utils/abort.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/** Creates an `AbortError` object matching the Fetch API. */
|
||||
function abortError() {
|
||||
return new DOMException('The signal has been aborted', 'AbortError');
|
||||
}
|
||||
|
||||
export { abortError };
|
||||
@@ -51,7 +51,7 @@ async function updateEvent<K extends number, E extends EventStub>(
|
||||
fn: (prev: NostrEvent | undefined) => E,
|
||||
c: AppContext,
|
||||
): Promise<NostrEvent> {
|
||||
const [prev] = await eventsDB.filter([filter], { limit: 1 });
|
||||
const [prev] = await eventsDB.query([filter], { limit: 1 });
|
||||
return createEvent(fn(prev), c);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user