Permalink
Browse files

1) Fixed a bug in the readme

  • Loading branch information...
1 parent cd128ec commit d96a2b85a134ed98f7ef9fcb94c9a6dd94729a54 @freethenation committed Oct 5, 2012
Showing with 7 additions and 7 deletions.
  1. +6 −6 README.md
  2. +1 −1 package.json
View
@@ -26,10 +26,10 @@ If the previous function threw an error, it is passed as the second parameter to
steps = []
steps.push (step, err)->
console.log("working on the first thing")
- setTimeout(300, step.next)
+ setTimeout(step.next, 300)
steps.push (step, err)->
console.log("working on second thing whos callback returns stuff")
- setTimeout(300, step.next, "someString", 6969)
+ setTimeout(step.next, 300, "someString", 6969)
# if the function calling the callback passes arguments, they are passed as additional arguments to the function.
steps.push (step, err, someString, someNumber)->
console.log("callback argument 1: " + someString)
@@ -64,9 +64,9 @@ run when all of the tasks are complete
steps = []
steps.push (step, err)->
console.log("Starting the first task")
- setTimeout(300, step.spawn())
+ setTimeout(step.spawn(), 300)
console.log("Starting the second task")
- setTimeout(600, step.spawn())
+ setTimeout(step.spawn(), 600)
#tasks are started immediately so you should call next to let the library know you are done spawning tasks
step.next()
funcflow = require('funcflow')
@@ -80,11 +80,11 @@ Using an optional parameter, state can be passed to all the step functions
step.sharedFunc(1)
console.log(step.sharedString)
step.sharedString = "step 1 has been here"
- setTimeout(300, step.next)
+ setTimeout(step.next, 300)
steps.push (step, err)->
step.sharedFunc(2)
console.log(step.sharedString)
- setTimeout(300, step.next)
+ setTimeout(step.next, 300)
sharedStateObject = {
sharedString:"step 1 has not modified me"
sharedFunc:(stepNum)->console.log("Starting Step " + stepNum)
View
@@ -1,6 +1,6 @@
{
"name": "funcflow"
- , "version": "1.0.2"
+ , "version": "1.0.3"
, "description": "Simplifies asynchronous control flow in javascript making making parallel code, synchronous code, and error handling simple"
, "homepage": "https://github.com/freethenation/funcflow"
, "keywords": ["async", "parallel", "synchronous", "coffee", "callback", "flow", "control", "coffeescript"]

0 comments on commit d96a2b8

Please sign in to comment.