mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-12 07:12:54 +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';
|
'use strict';
|
||||||
|
|
||||||
const { Node } = require('@noodl/runtime');
|
|
||||||
|
|
||||||
const Model = require('@noodl/runtime/src/model');
|
const Model = require('@noodl/runtime/src/model');
|
||||||
const Collection = require('@noodl/runtime/src/collection');
|
const Collection = require('@noodl/runtime/src/collection');
|
||||||
|
|
||||||
var SetVariableNodeDefinition = {
|
const SetVariableNodeDefinition = {
|
||||||
name: 'Set Variable',
|
name: 'Set Variable',
|
||||||
docs: 'https://docs.noodl.net/nodes/data/variable/set-variable',
|
docs: 'https://docs.noodl.net/nodes/data/variable/set-variable',
|
||||||
category: 'Data',
|
category: 'Data',
|
||||||
@@ -16,6 +14,13 @@ var SetVariableNodeDefinition = {
|
|||||||
|
|
||||||
internal.variablesModel = Model.get('--ndl--global-variables');
|
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: {
|
outputs: {
|
||||||
done: {
|
done: {
|
||||||
type: 'signal',
|
type: 'signal',
|
||||||
|
|||||||
Reference in New Issue
Block a user