Skip to content

Throttle config option #7

@alexcroox

Description

@alexcroox

When using this plugin I have to wrap my functions in the same throttle code every time to stop them firing too often:

import throttle from 'lodash.throttle'

methods: {
    onResize: throttle(
      function ({ width, height }) {
        // Logic
      },
      1000,
      { trailing: true }
    )
  }

It would be great if this could be part of the initial config (optionally of course)

Vue.use(VueResizeObserver, {
 throttle: {
   waitMs: 1000,
   trailing: true
  }
})

More config options: https://lodash.com/docs/4.17.15#throttle

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions