Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Port default values #149

Closed
bergie opened this Issue Mar 2, 2014 · 0 comments

Comments

Projects
None yet
1 participant
Owner

bergie commented Mar 2, 2014

Currently a common pattern is to handle configuration ports like this:

@configVar = false
@inPorts =
  # ...some ports
  config: new noflo.Port 'boolean'
@inPorts.config.on 'data', (@configVar) =>

It would be nice to make these defaults discoverable in places like noflo-ui, and remove some boilerplate by providing a "default value" in options. This default would be sent to the port at component initialization time, before IIPs.

So, the above would become something like:

@inPorts = new noflo.InPorts
  # ...some ports
  config:
    datatype: 'boolean'
    default: false
@inPorts.config.on 'data', (@configVar) =>

@kenhkan kenhkan referenced this issue Mar 2, 2014

Merged

Port API specs #150

@bergie bergie closed this in a8de0e2 Mar 2, 2014

@KevinHoward KevinHoward added a commit to KevinHoward/noflo that referenced this issue Jun 30, 2014

@bergie @KevinHoward bergie + KevinHoward Implement port default values, fixes #149 7a8a32f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment