This repository has been archived by the owner on Apr 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47b98b4
commit 5b17371
Showing
9 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets":["flow", "env"] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Formal | ||
<q>being in accordance with the usual requirements, customs, etc</q> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare function preventSubmission(submission: Event, callback?: () => void): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.preventSubmission = preventSubmission; | ||
function preventSubmission(submission, callback) { | ||
submission.preventDefault(); | ||
if (callback) { | ||
callback(); | ||
} else { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// @flow | ||
|
||
export function preventSubmission(submission: Event, callback?: () => void): void { | ||
submission.preventDefault(); | ||
if (callback) { | ||
callback(); | ||
} else { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "customary", | ||
"version": "1.0.0", | ||
"description": "Prevents form submission after native validation has taken place.", | ||
"main": "lib/jack.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"flow": "flow", | ||
"build:transpile": "babel src --out-dir lib", | ||
"build:type": "flow-copy-source -v src lib", | ||
"build": "npm run build:transpile && npm run build:type", | ||
"prepublish": "npm run build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/DanArthurGallagher/formal.git" | ||
}, | ||
"keywords": [ | ||
"front-end" | ||
], | ||
"author": "Daniel Arthur Gallagher", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/DanArthurGallagher/formal/issues" | ||
}, | ||
"homepage": "https://github.com/DanArthurGallagher/formal#readme", | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-preset-env": "^1.4.0", | ||
"babel-preset-flow": "^6.23.0", | ||
"flow-bin": "^0.45.0", | ||
"flow-copy-source": "^1.1.0" | ||
}, | ||
"browserslist": [ | ||
"last 2 Chrome versions", | ||
"last 2 Firefox versions", | ||
"last 1 Safari version", | ||
"last 1 iOS version", | ||
"last 1 Samsung version", | ||
"last 1 Edge version" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// @flow | ||
|
||
export function preventSubmission(submission: Event, callback?: () => void): void { | ||
submission.preventDefault(); | ||
if (callback) { | ||
callback(); | ||
} else { | ||
return; | ||
} | ||
} |