Skip to content

Commit

Permalink
Fix callable clock type
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysova committed Aug 2, 2024
1 parent 4e1f288 commit 6263786
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import {
createEvent,
createStore,
Event,
EventCallable,
is,
sample,
Store,
} from 'effector';
import {DOMTag, h, handler, node, spec} from 'forest';

export function onAppMount(clock: Event<void>) {
export function onAppMount(clock: EventCallable<void>) {
h('div', () => node(() => clock()));
}

Expand Down Expand Up @@ -124,13 +125,7 @@ export function createLink() {
return Link;
}

function toStore<T extends Record<string, any>>(
value:
| Store<T>
| {
[Key in keyof T]: Store<T[Key]> | T[Key];
},
): Store<T> {
function toStore<T extends Record<string, any>>(value: Store<T> | T): Store<T> {
if (is.store(value)) {
return value;
}
Expand Down

0 comments on commit 6263786

Please sign in to comment.