Skip to content

Releases: bigeasy/cadence

Cadence 0.0.35

06 Feb 03:07
Compare
Choose a tag to compare

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

  • Release version 0.0.35. #192.
  • Remove boolean handlers. #191.
  • Implement promise handlers. #190.
  • Undefined return and no callbacks means skip. #189.
  • Use the elements of a returned array as arguments to subsequent step. #188.

Cadence 0.0.34

02 Feb 05:39
Compare
Choose a tag to compare

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 to createHandler. #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 to invocation. #182.
  • Tidy. #181.
  • Rename cb to callback in invoke. #179.
  • Rename invocation to frame. #178.
  • Rename async to step. #177.
  • Rename callback to denouement. #176.
  • Add repository type to package.json #175.
  • Upgrade Proof to 0.0.41. #166.

Cadence 0.0.31

14 Jan 05:26
Compare
Choose a tag to compare

License Synchronization

Update Proof to 0.0.38 so that Cadence and its sold dependency share the same license text.

Issue by Issue

  • Release version 0.0.32. #170.
  • Upgrade Proof to 0.0.38. #169.

Cadence 0.0.30

14 Jan 05:04
Compare
Choose a tag to compare

Add Linking Preamble

Clarify that the license is covered under the GNU Affero General Public License.

Issue by Issue

  • Release version 0.0.30. #168.
  • Add preamble to linking exception. #167.

Cadence 0.0.29

12 Jan 21:10
Compare
Choose a tag to compare

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

  • Release version 0.0.29. #165.
  • Add Affero GPL 3.0. #164.

Cadence 0.0.27

29 Dec 06:49
Compare
Choose a tag to compare

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

  • String indicates a property assignment. #157.
  • Boolean indicates loop termination on truthiness. #158.

Cadence 0.0.24

02 Feb 01:10
Compare
Choose a tag to compare

Issue by Issue

  • Fix catch of propagated exception. Closes #142.
  • Upgrade Proof to 0.0.32. #141.

Cadence 0.0.23

02 Feb 01:10
Compare
Choose a tag to compare

Issue by Issue

  • Implement events using -1 as the sigil. #139.
  • All createHandler invocations should have an explicit this, not null. #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.

Cadence 0.0.22

02 Feb 01:07
Compare
Choose a tag to compare

Issue by Issue

  • Finalizers are not invoked with correct this. #124.
  • Loop returns inadvertently creating arrays. #127.
  • Unable to loop through exception handlers. #126.
  • Catch functions are not invoked with the correct this. #125.

Cadence 0.0.21

02 Feb 01:06
Compare
Choose a tag to compare

Issue by Issue

  • Implement gathered loops. #122.
  • Implement each loops. #121.
  • Implement counted loops. #120.
  • Implement endless loops. #119.