-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
It would be great if the mounted hook had props support. Trigger an event by passing incoming props to it.
type ComponentProps = {
foo: string
bar: boolean
}
const $bar = createStore(false);
const mounted = createEvent<ComponentProps>()
const Component: FC<ComponentProps> = ({foo, bar}) => ...
const ComponentReflected = reflect({
view: Component,
bind: {
bar: $bar
},
hooks: { mounted }
})
<ComponentReflected foo="awesome"/>
mounted.watch(console.log) // { foo: "awesome", bar: false }This would simplify the code, since now we have to make a separate gate in Component for such a case.
kireevmpAlexandrHoroshih
Metadata
Metadata
Assignees
Labels
No labels