Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Operation } from "effection";
import type { Next } from "./types.js";

export interface BaseCtx {
// deno-lint-ignore no-explicit-any
[key: string]: any;
}

Expand Down
2 changes: 0 additions & 2 deletions src/query/create-key.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isObject } from "./util.js";

// deno-lint-ignore no-explicit-any
const deepSortObject = (opts?: any) => {
if (!isObject(opts)) return opts;
return Object.keys(opts)
Expand Down Expand Up @@ -34,7 +33,6 @@ const tinySimpleHash = (s: string) => {
/**
* This function used to set `ctx.key`
*/
// deno-lint-ignore no-explicit-any
export const createKey = (name: string, payload?: any) => {
const normJsonString =
typeof payload !== "undefined"
Expand Down
2 changes: 0 additions & 2 deletions src/query/util.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { ApiRequest, RequiredApiRequest } from "./types.js";

export function* noop() {}
// deno-lint-ignore no-explicit-any
export const isFn = (fn?: any) => fn && typeof fn === "function";
// deno-lint-ignore no-explicit-any
export const isObject = (obj?: any) => typeof obj === "object" && obj !== null;

export const mergeHeaders = (
Expand Down
2 changes: 0 additions & 2 deletions src/store/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ export function createSchema<
>(slices: O = defaultSchema<O>()): [FxSchema<S, O>, S] {
const db = Object.keys(slices).reduce<FxSchema<S, O>>(
(acc, key) => {
// deno-lint-ignore no-explicit-any
(acc as any)[key] = slices[key](key);
return acc;
},
{} as FxSchema<S, O>,
);

const initialState = Object.keys(db).reduce((acc, key) => {
// deno-lint-ignore no-explicit-any
(acc as any)[key] = db[key].initialState;
return acc;
}, {}) as S;
Expand Down
3 changes: 0 additions & 3 deletions src/store/slice/any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ export function createAny<V, S extends AnyState = AnyState>({
name: name as string,
initialState,
set: (value) => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = value;
},
reset: () => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = initialState;
},
select: (state) => {
// deno-lint-ignore no-explicit-any
return (state as any)[name];
},
};
Expand Down
1 change: 0 additions & 1 deletion src/store/slice/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ export const createLoaders = <
});
},
reset: () => (s) => {
// deno-lint-ignore no-explicit-any
(s as any)[name] = initialState;
},
resetByIds: (ids: string[]) => (s) => {
Expand Down
5 changes: 0 additions & 5 deletions src/store/slice/num.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,22 @@ export function createNum<S extends AnyState = AnyState>({
schema: "num",
initialState,
set: (value) => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = value;
},
increment:
(by = 1) =>
(state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] += by;
},
decrement:
(by = 1) =>
(state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] -= by;
},
reset: () => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = initialState;
},
select: (state) => {
// deno-lint-ignore no-explicit-any
return (state as any)[name];
},
};
Expand Down
4 changes: 0 additions & 4 deletions src/store/slice/obj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,17 @@ export function createObj<V extends AnyState, S extends AnyState = AnyState>({
name: name as string,
initialState,
set: (value) => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = value;
},
reset: () => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = initialState;
},
update:
<P extends keyof V>(prop: { key: P; value: V[P] }) =>
(state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name][prop.key] = prop.value;
},
select: (state) => {
// deno-lint-ignore no-explicit-any
return (state as any)[name];
},
};
Expand Down
3 changes: 0 additions & 3 deletions src/store/slice/str.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ export function createStr<S extends AnyState = AnyState>({
name: name as string,
initialState,
set: (value) => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = value;
},
reset: () => (state) => {
// deno-lint-ignore no-explicit-any
(state as any)[name] = initialState;
},
select: (state) => {
// deno-lint-ignore no-explicit-any
return (state as any)[name];
},
};
Expand Down
5 changes: 0 additions & 5 deletions src/store/slice/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export function createTable<
});
},
set: (entities) => (s) => {
// deno-lint-ignore no-explicit-any
(s as any)[name] = entities;
},
remove: (ids) => (s) => {
Expand All @@ -164,19 +163,15 @@ export function createTable<
Object.keys(entity).forEach((prop) => {
const val = entity[prop];
if (Array.isArray(val)) {
// deno-lint-ignore no-explicit-any
const list = val as any[];
// deno-lint-ignore no-explicit-any
(state as any)[id][prop].push(...list);
} else {
// deno-lint-ignore no-explicit-any
(state as any)[id][prop] = entities[id][prop];
}
});
});
},
reset: () => (s) => {
// deno-lint-ignore no-explicit-any
(s as any)[name] = initialState;
},
...selectors,
Expand Down
2 changes: 0 additions & 2 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export function createStore<S extends AnyState>({

const [nextState, patches, _] = produceWithPatches(getState(), (draft) => {
// TODO: check for return value inside updater
// deno-lint-ignore no-explicit-any
upds.forEach((updater) => updater(draft as any));
});
ctx.patches = patches;
Expand Down Expand Up @@ -178,7 +177,6 @@ export function createStore<S extends AnyState>({
// refer to pieces of business logic -- that can also mutate state
dispatch,
// stubs so `react-redux` is happy
// deno-lint-ignore no-explicit-any
replaceReducer<S = any>(
_nextReducer: (_s: S, _a: AnyAction) => void,
): void {
Expand Down
2 changes: 0 additions & 2 deletions src/store/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ export interface FxStore<S extends AnyState> {
update: (u: StoreUpdater<S> | StoreUpdater<S>[]) => Operation<UpdaterCtx<S>>;
reset: (ignoreList?: (keyof S)[]) => Operation<UpdaterCtx<S>>;
run: ReturnType<typeof createRun>;
// deno-lint-ignore no-explicit-any
dispatch: (a: AnyAction | AnyAction[]) => any;
replaceReducer: (r: (s: S, a: AnyAction) => S) => void;
getInitialState: () => S;
// deno-lint-ignore no-explicit-any
[Symbol.observable]: () => any;
}

Expand Down
1 change: 0 additions & 1 deletion src/test/mdw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const emptyUser: User = { id: "", name: "", email: "" };
const mockUser: User = { id: "1", name: "test", email: "test@test.com" };
const mockUser2: User = { id: "2", name: "two", email: "two@test.com" };

// deno-lint-ignore no-explicit-any
const jsonBlob = (data: any) => {
return JSON.stringify(data);
};
Expand Down
2 changes: 0 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ export interface LoaderState<M extends AnyState = AnyState>
export type LoaderPayload<M extends AnyState> = Pick<LoaderItemState<M>, "id"> &
Partial<Pick<LoaderItemState<M>, "message" | "meta">>;

// deno-lint-ignore no-explicit-any
export type AnyState = Record<string, any>;

// deno-lint-ignore no-explicit-any
export interface Payload<P = any> {
payload: P;
}
Expand Down
Loading