Skip to content

Experiment with returning function expressions / closures as init() return for simpler modules #19

@jfrux

Description

@jfrux

This would provide a seemless interface for simple modules.
If a module has a single utility function then it could simply do

component name="say_something" {
   public any function init() {
         return function(arg1,arg2,arg3) {
               return arg1 & " " & arg2 & " " & arg3;
         }
   }
}

Allows for smoother requiring of the module as a function versus a redundant component.

var say = require("say_something");

say("this","is","simpler"); 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions