Re-uses generators, lazy-loads them. Initializing generators is expensive and slow; this change makes scrubbing through a list with feedback feel way more natural.
Prepare after call. Best practice is to trigger the feedback first, then call prepare to get ready for the next one. Calling prepare before each time slightly delays the actual haptics from playing.
I use impactLight in my app and can call it 20-30 times in 1 second. This change made a huge difference, changing it from stuttering haptic feedback to smooth and consistent.
Resolves #42
This increases performance on iOS in two ways:
I use
impactLight
in my app and can call it 20-30 times in 1 second. This change made a huge difference, changing it from stuttering haptic feedback to smooth and consistent.