How to use the @nakedobjects/restful-objects.ActionRepresentation function in @nakedobjects/restful-objects

To help you get started, we’ve selected a few @nakedobjects/restful-objects examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / cicero / src / cicero-commands / command-result.ts View on Github external
export function getParametersAndCurrentValue(action: Ro.ActionMember | Ro.ActionRepresentation | Ro.InvokableActionMember, context: ContextService): Dictionary {

    if (action instanceof Ro.InvokableActionMember || action instanceof Ro.ActionRepresentation) {
        const parms = action.parameters();
        const cachedValues = context.getDialogCachedValues(action.actionId());
        const values = mapValues(parms, p => {
            const value = cachedValues[p.id()];
            return value === undefined ? p.default() : value;
        });
        return values;
    }
    return {};
}