Skip to content

Commit

Permalink
[flow] Increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jul 29, 2017
1 parent cdb5f28 commit 6f4b2b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/internal/ButtonBase.js
Expand Up @@ -196,6 +196,7 @@ class ButtonBase extends Component<DefaultProps, Props, State> {
});

handleTouchStart = createRippleHandler(this, 'TouchStart', 'start');

handleTouchEnd = createRippleHandler(this, 'TouchEnd', 'stop');

handleBlur = createRippleHandler(this, 'Blur', 'stop', () => {
Expand Down
8 changes: 5 additions & 3 deletions src/internal/createRippleHandler.js
@@ -1,7 +1,7 @@
// @flow weak
// @flow

export default function createRippleHandler(instance, eventName, action, cb) {
return function handleEvent(event) {
function createRippleHandler(instance: Object, eventName: string, action: string, cb: ?Function) {
return function handleEvent(event: SyntheticUIEvent) {
if (cb) {
cb.call(instance, event);
}
Expand All @@ -21,3 +21,5 @@ export default function createRippleHandler(instance, eventName, action, cb) {
return true;
};
}

export default createRippleHandler;

0 comments on commit 6f4b2b3

Please sign in to comment.