Releases: bigeasy/cadence
Cadence 0.0.35
Array Returns as Arguments
Now when an array is returned using return
the elements of the array are used
as the arguments to the subsequent step. If you want to return multiple values
to be passed as multiple arguments to the subsequent step, return them as an
array.
So, now if you want actually want to return an array to be used as the sole argument to the subsequent step, you need to put that array in an array to be explicit. When in doubt, wrap it up in an array.
Issue by Issue
Cadence 0.0.34
Fix Gathered Loops
Create a zero arity callback on the calling frame before invoking the return of a gathered, looping sub-cadence. If the gathered, looping sub-cadence is the final callback for the caller, then the explicit return will invoke the next step with the scalar return value. The internal callback holds onto the caller's frame so that we can rewrite the callback results, then return the arrayed results to the next step.
Source Tidy
Tidy source code including structural changes to the internal callback that has a different signature than the standard error first callback. First, I renamed the internal callback to denouement. Second, instead of passing the results as flattened arguments to the internal callback, the denouement, the results are passed around as an array of results.
The rest of the source tidy is bits of dead code, naming and some indentation. Notably, I renamed invocation
to frame
.
Issue by Issue
- Release version 0.0.34. #187.
- Pass
frame
tocreateHandler
. #186. - Gathered loops returning before updating callback results. #185.
- Pass results as array to denouement. #184.
- Move change log to GitHub Releases. #183.
- Rename
master
toinvocation
. #182. - Tidy. #181.
- Rename
cb
tocallback
ininvoke
. #179. - Rename
invocation
toframe
. #178. - Rename
async
tostep
. #177. - Rename
callback
todenouement
. #176. - Add repository type to
package.json
#175. - Upgrade Proof to 0.0.41. #166.
Cadence 0.0.31
Cadence 0.0.30
Cadence 0.0.29
Affero GPL with Linking Exception
Instead of LGPL, I've decided to use Affero because Node.js wants to live in the data center. I've added the 0mq linking exception to accommodate projects that do not want to use a Copyleft license. I've documented my open source strategy and feedback is welcome.
As noted, I'm the sole contributor to this library, and the sole consumer. Thus, this license applies to the entire library, regardless of any contradictory license files captured by the source control.
Issue by Issue
Cadence 0.0.27
Loop Terminate If
Now you can indicate that a loop should terminate when a result is truthy or falsey. This can be used with iterators that return null
to terminate loops.
cadence(function (step, iterator) {
var records = []
step(function () {
step(function () {
iterator.next(step(false))
}, function (value) {
records.push(value)
})()
})
})
In the above, the terminal condition is when the return value is falsey. We've not had a use for the boolean yet, so let's try this out.
Set Object Properties Asynchronously
When you specify a string, you now specify a property assignment. The first return value is assigned to the this
object.
var object = {}, fs = require('fs'), ok = require('assert').ok
object.method = cadence(function (step, value) {
step(function () {
fs.readFile(__filename, 'utf8', step('body'))
}, function (body) {
return this.body == body
})
})
object.method(1, function (error, result) {
ok(result, 'this.body equals body')
})
The property assignment does not prevent the value from being returned as normal.
Issue by Issue
Cadence 0.0.24
Cadence 0.0.23
Issue by Issue
- Implement events using
-1
as the sigil. #139. - All
createHandler
invocations should have an explicitthis
, notnull
. #132. - Implement arguments passed to into counted loops. #134.
- Include index and array in each loop. #130.
- Remove double quotes. #137.
- Implement loops without using
step.jump
. #138. - Remove
march
. #136. - Catch functions to not return their results to the next step. #135.
- Implement loop labels. #131.
- Aways flatten callback arguments. #133.
- Implement endless loop initializers. #129.