Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo79 committed Mar 25, 2024
1 parent 6a61bad commit 0962e7e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
"editor.defaultFormatter": "denoland.vscode-deno",
"deno.codeLens.implementations": true,
"deno.codeLens.test": true,
"deno.testing.enable": true
}
}
2 changes: 1 addition & 1 deletion src/objects/owner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Owner {
static runWithOwner<T>(
fn: () => T,
owner: typeof CURRENTOWNER,
observer: typeof CURRENTOBSERVER
observer: typeof CURRENTOBSERVER,
): T | typeof ERRORTHROWN_SYMBOL {
const PREV_OWNER = CURRENTOWNER;
const PREV_OBSERVER = CURRENTOBSERVER;
Expand Down
2 changes: 1 addition & 1 deletion src/objects/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Root<T = unknown> extends Owner {
const result = Owner.runWithOwner(
() => this.fn(this.dispose.bind(this)),
this,
undefined
undefined,
);

return result === ERRORTHROWN_SYMBOL ? undefined! : result;
Expand Down
4 changes: 2 additions & 2 deletions src/test/withOwner.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type RootFunction<T> = (dispose: () => void) => T;

// OBSERVER
export type ObserverFunction<Prev, Next extends Prev = Prev> = (
prevValue: Prev
prevValue: Prev,
) => Next;

// EFFECT
Expand All @@ -63,13 +63,13 @@ export type MemoOptions<T> = ObservableOptions<T>;
// ON
// transforms a tuple to a tuple of accessors in a way that allows generics to be inferred
export type AccessorArray<T> = [
...Extract<{ [K in keyof T]: Accessor<T[K]> }, readonly unknown[]>
...Extract<{ [K in keyof T]: Accessor<T[K]> }, readonly unknown[]>,
];

export type OnEffectFunction<S, Prev, Next extends Prev = Prev> = (
input: S,
prevInput: S | undefined,
prev: Prev
prev: Prev,
) => Next;

export type OnOptions = { defer: boolean };
Expand Down

0 comments on commit 0962e7e

Please sign in to comment.