Skip to content

Commit

Permalink
Release/0.9.2 (#162)
Browse files Browse the repository at this point in the history
* fix: 🐛 ClassType args type `..args: any[]`
  • Loading branch information
foreleven authored Jul 24, 2020
1 parent d58c059 commit d01c761
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stated-bean",
"version": "0.9.1",
"version": "0.9.2",
"description": "A light but scalable state management library with react hooks",
"repository": "[email protected]:mjolnirjs/stated-bean.git",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useObserveEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export function useObserveEffect<T>(bean: T, effect: FunctionPropertyNames<T> |
const context = useContext(StateBeanContext);
const container = context.container;

if (typeof effect === 'function') {
console.log(effect.name);
}

if (container === undefined) {
throw new Error('not found container');
}
Expand Down
3 changes: 2 additions & 1 deletion src/types/ClassType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
// eslint-disable-next-line @typescript-eslint/no-type-alias
export type ClassType<T = unknown> = new (...args: unknown[]) => T;
export type ClassType<T = unknown> = new (...args: any[]) => T;

// eslint-disable-next-line @typescript-eslint/no-type-alias
export type InstanceType<T extends ClassType<T>> = T extends ClassType<infer R> ? R : never;
Expand Down

0 comments on commit d01c761

Please sign in to comment.