effector / effector/effector

[forest] Ability to pass handlers array with configurations for each handler

Open
#752 0 comments 2 reactions 0 assignees View on GitHub
forest good first issue RFC
Dominant language
TypeScript
Stars
4.9k
Forks
280
Avg merge
2d 6h
Merged PRs (30d)
7

Description

## Proposal
At the moment for spec/h config we have this kind of handler param
```typescript
handler?:
| {[domEvent: string]: Event}
| {
config: {
passive?: boolean
capture?: boolean
prevent?: boolean
stop?: boolean
}
on: {[domEvent: string]: Event}
}
```
Would be nice if it will be possible to pass an array of handlers with configurations for each event instead of just only 1.

## Use case
```typescript
h('input', {
handler: [
{
config: {
stop: true
},

on: { click: someEvent }
},
{
on: { focus: otherEvent }
}
]
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.