This documentation is currently being moved to our new documentation site.

Please view or edit the documentation there, instead.

If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Using Invokers

Invokers are a way of creating public component functions whose arguments are resolved from the environment at invocation time.

An invoker declaration is resolved every time it is invoked. This is useful if a function needs to do something different in different contexts. However, the resolution is time consuming, so use invokers prudently.

Invokers can be used as listeners:

fluid.defaults("my.component", {
    ...
    invokers: {
        func1: {
            funcName: "my.component.func",
            args: ["{that}", "{arguments}.0"]
        }
    },
    listeners: {
        onSomething: "{that}.func1"
    },
    ...
});