effector icon indicating copy to clipboard operation
effector copied to clipboard

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

Open hyze2d opened this issue 2 years ago • 0 comments

Proposal

At the moment for spec/h config we have this kind of handler param

 handler?:
      | {[domEvent: string]: Event<any>}
      | {
          config: {
            passive?: boolean
            capture?: boolean
            prevent?: boolean
            stop?: boolean
          }
          on: {[domEvent: string]: Event<any>}
        }

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

h('input', {
  handler: [
    {
      config: {
        stop: true
      },

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

hyze2d avatar Aug 02 '22 09:08 hyze2d