onInvoke method

  1. @override
void onInvoke(
  1. Map params
)
override

This is called when this node is invoked. You can return the following types from this method:

You can also return a future that resolves to one (like if the method is async) of the following types:

Implementation

@override
void onInvoke(Map params) async {
  String wp = params['Path'];
  var rp = NodeNamer.createName(wp);
  var p = Path(path);
  var targetPath = '${p.parentPath}/$rp';
  var node = await _link.requester?.getRemoteNode(wp);
  _link.addNode(targetPath, <String, dynamic>{
    r'$name': wp,
    r'$path': wp,
    r'$is': 'watchPath',
    r'$type': node?.configs[r'$type'],
  });

  _link.save();
}