From 0962e7e8be6f6c835fbde19d5a21e59ea714e48e Mon Sep 17 00:00:00 2001 From: apollo79 <90517340+apollo79@users.noreply.github.com> Date: Mon, 25 Mar 2024 08:30:28 +0100 Subject: [PATCH] style: format --- .vscode/settings.json | 3 +-- src/objects/owner.ts | 2 +- src/objects/root.ts | 2 +- src/test/withOwner.test.ts | 4 ++-- src/types.ts | 6 +++--- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index be2cc2f..0fe0f0c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,4 @@ "editor.defaultFormatter": "denoland.vscode-deno", "deno.codeLens.implementations": true, "deno.codeLens.test": true, - "deno.testing.enable": true -} +} \ No newline at end of file diff --git a/src/objects/owner.ts b/src/objects/owner.ts index bdcc4c6..74bd974 100644 --- a/src/objects/owner.ts +++ b/src/objects/owner.ts @@ -17,7 +17,7 @@ export class Owner { static runWithOwner( fn: () => T, owner: typeof CURRENTOWNER, - observer: typeof CURRENTOBSERVER + observer: typeof CURRENTOBSERVER, ): T | typeof ERRORTHROWN_SYMBOL { const PREV_OWNER = CURRENTOWNER; const PREV_OBSERVER = CURRENTOBSERVER; diff --git a/src/objects/root.ts b/src/objects/root.ts index cac3e61..8803582 100644 --- a/src/objects/root.ts +++ b/src/objects/root.ts @@ -23,7 +23,7 @@ export class Root extends Owner { const result = Owner.runWithOwner( () => this.fn(this.dispose.bind(this)), this, - undefined + undefined, ); return result === ERRORTHROWN_SYMBOL ? undefined! : result; diff --git a/src/test/withOwner.test.ts b/src/test/withOwner.test.ts index 807f9b2..997afed 100644 --- a/src/test/withOwner.test.ts +++ b/src/test/withOwner.test.ts @@ -1,11 +1,11 @@ -import { createRoot, getContext, withOwner, catchError } from "#/mod.ts"; +import { catchError, getContext, withOwner } from "#/mod.ts"; import { withContext } from "~/methods/withContext.ts"; import { + assertSpyCallArg, assertStrictEquals, describe, it, spy, - assertSpyCallArg, } from "./util.ts"; describe("runWithOwner", () => { diff --git a/src/types.ts b/src/types.ts index ed99949..1eea328 100644 --- a/src/types.ts +++ b/src/types.ts @@ -45,7 +45,7 @@ export type RootFunction = (dispose: () => void) => T; // OBSERVER export type ObserverFunction = ( - prevValue: Prev + prevValue: Prev, ) => Next; // EFFECT @@ -63,13 +63,13 @@ export type MemoOptions = ObservableOptions; // ON // transforms a tuple to a tuple of accessors in a way that allows generics to be inferred export type AccessorArray = [ - ...Extract<{ [K in keyof T]: Accessor }, readonly unknown[]> + ...Extract<{ [K in keyof T]: Accessor }, readonly unknown[]>, ]; export type OnEffectFunction = ( input: S, prevInput: S | undefined, - prev: Prev + prev: Prev, ) => Next; export type OnOptions = { defer: boolean };