Skip to content

Commit

Permalink
remove nouse code
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoazhen committed Dec 5, 2013
1 parent 1c8c17a commit 79d5616
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 54 deletions.
94 changes: 47 additions & 47 deletions example/example.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Example</title>
<script type="text/javascript" src="../src/Flow.js"></script>
</head>
<body>
<h1>Results in the console</h1>
<script type="text/javascript">
var processExemple = new Flow(
function (a, b, c) {
// If you want to using the once function, you have to give a name for the function
// like once and onceInAll

this.onceInAll('t11', function () {
console.log('ALL 1-1'); // Just run once even you back to this step
});
console.log(1);
this.once('t12', function () {
console.log('Step 1-2 param:' + a + b + c); // Run once every time go to this step
});
}
, function (e, f, g) {
console.log(2);
this.once('t22', function () {
console.log('Step 2-1 param:' + e + f + g);
});
}
, new Flow(function () {
console.log("Sub flow 3.1");
}, function () {
console.log("Sub flow 3.2");
}, new Flow()
)
, function () {
console.log(4);
}
, function () {
console.log(5);
}).go(1, 2, 3).go(4, 5, 6).go().go().go().go().go()
.go().go().go().go().go().go().go()
.back().back().back().back(4, 5, 6).action().back(1, 2, 3).action();
// Here you can pass the args with go(),back(),action() for functions
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Example</title>
<script type="text/javascript" src="../src/Flow.js"></script>
</head>
<body>
<h1>Results in the console</h1>
<script type="text/javascript">
var processExemple = new Flow(
function (a, b, c) {
// If you want to using the once function, you have to give a name for the function
// like once and onceInAll

this.onceInAll('t11', function () {
console.log('ALL 1-1'); // Just run once even you back to this step
});
console.log(1);
this.once('t12', function () {
console.log('Step 1-2 param:' + a + b + c); // Run once every time go to this step
});
}
, function (e, f, g) {
console.log(2);
this.once('t22', function () {
console.log('Step 2-1 param:' + e + f + g);
});
}
, new Flow(function () {
console.log("Sub flow 3.1");
}, function () {
console.log("Sub flow 3.2");
}, new Flow()
)
, function () {
console.log(4);
}
, function () {
console.log(5);
}).go(1, 2, 3).go(4, 5, 6).go().go().go().go().go()
.go().go().go().go().go().go().go()
.back().back().back().back(4, 5, 6).action().back(1, 2, 3).action();
// Here you can pass the args with go(),back(),action() for functions
</script>
</body>
</html>
9 changes: 2 additions & 7 deletions src/Flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

define(function (require, exports) {

//If have dependencies, get them here
var _ = require('underscore');

var undef = undefined;
var ArrayProto = Array.prototype;
var ObjProto = Object.prototype;
Expand Down Expand Up @@ -420,11 +417,9 @@
//the code does not have dependencies, or
//dependencies fit the call pattern below.

var mapping = {"underscore": "_"};

factory(function (value) {
if (mapping[value]) {
value = mapping[value];
if (shim[value]) {
value = shim[value];
}
return window[value];
}, (window));
Expand Down

0 comments on commit 79d5616

Please sign in to comment.