Skip to content
This repository was archived by the owner on Dec 29, 2020. It is now read-only.
This repository was archived by the owner on Dec 29, 2020. It is now read-only.

Simplify the API? #26

@dandv

Description

@dandv

The current flow for detecting a shake looks more complicated than it needs to be:

var myShakeEvent = new Shake({ ... senstivity options ... });
window.addEventListener('shake', shakeEventDidOccur, false);
window.removeEventListener('shake', shakeEventDidOccur, false);
myShakeEvent.stop();

@leecrossley's cordova-plugin-shake-detection has a minimally simple API:

shake.startWatch(shakeEventDidOccur, /* ... sensitivity options ... */);
shake.stopWatch();

Could the API be simplified?

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