addAction method
- Object smAction,
- ActionFunc func
Add an action mapping it from the action code to the handler.
Assert validation is performed to ensure it is valid.
Dart will ensure func
is of type ActionFunc.
Implementation
SamAction addAction(Object smAction,ActionFunc func) {
assert(
((sf.enumTypes.length > 0) && ((sf.enumTypes.firstWhere((_) => (smAction.runtimeType == _),orElse:(() => null))) != null)) ||
(smAction.runtimeType == SE.sa_change.runtimeType)
,"invalid action type ${smAction.runtimeType} value $smAction");
assert(!(smAction is String));
assert(!fnMap.containsKey("$smAction"),"$smAction already defined in action mapping table");
//log("addAction $smAction type ${smAction.runtimeType} ${m.enums.runtimeType} ${(m.enums as List)[0].runtimeType}");
fnMap["$smAction"] = func;
return this;
}