mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-10 14:22:53 +01:00
feat(runtime): 'Set Variable' node, add editor getInspectInfo (#80)
It is very nice to be able to inspect the value inside the variable even via the "Set Variable" node. Most of the time I see an additional variable node placed above the "Set Variable" node to just inspect the current value.
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
const { Node } = require('@noodl/runtime');
|
||||
|
||||
const Model = require('@noodl/runtime/src/model');
|
||||
const Collection = require('@noodl/runtime/src/collection');
|
||||
|
||||
var SetVariableNodeDefinition = {
|
||||
const SetVariableNodeDefinition = {
|
||||
name: 'Set Variable',
|
||||
docs: 'https://docs.noodl.net/nodes/data/variable/set-variable',
|
||||
category: 'Data',
|
||||
@@ -16,6 +14,13 @@ var SetVariableNodeDefinition = {
|
||||
|
||||
internal.variablesModel = Model.get('--ndl--global-variables');
|
||||
},
|
||||
getInspectInfo() {
|
||||
if (this._internal.name) {
|
||||
return this._internal.variablesModel.get(this._internal.name);
|
||||
}
|
||||
|
||||
return '[No value set]';
|
||||
},
|
||||
outputs: {
|
||||
done: {
|
||||
type: 'signal',
|
||||
|
||||
Reference in New Issue
Block a user