mirror of
https://github.com/noodlapp/noodl-docs.git
synced 2026-01-11 23:02:54 +01:00
Initial commit
Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com> Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com> Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com> Co-Authored-By: Michael Cartner <32543275+michaelcartner@users.noreply.github.com>
This commit is contained in:
36
nodes/data/variable/set-variable.md
Normal file
36
nodes/data/variable/set-variable.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Set Variable
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Set Variable
|
||||
|
||||
This node sets the **Value** of a [Variable](/nodes/data/variable/variable-node). You provide the new value on the **Value** input and trigger the <span className="ndl-signal">Do</span> action.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Name</span> | <##input:name##>The name of the **Variable** to set. Note: All **Variable** nodes with the same name will share the same data.<##input##> |
|
||||
| <span className="ndl-data">Value</span> | <##input:value##>The value that you want the **Variable** to get when you trigger the <span className="ndl-signal">Do</span> action.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Updates the value of the **Variable** to what is currently set on the input **Value**.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>This event is triggered when the **Variable** have been set.<##output##> |
|
||||
52
nodes/data/variable/variable-node.md
Normal file
52
nodes/data/variable/variable-node.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Variable
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Variable
|
||||
|
||||
Use this node to store a single data variable that will be globally accessible throughout the application. **Variable** works in a similar way as [Object](/nodes/data/object/object-node) but can only store one value.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The value can be dynamically stored, either by passing it a new value or by sending <span className="ndl-signal">signals</span> to the <span className="ndl-node">[Set Variable](/nodes/data/variable/set-variable)</span> node.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Storing a value
|
||||
|
||||
Give the Variable a name with the **Name** input and simply connect to **Value**, whenever the input connection is updated the value will be stored in the variable. You can also use the [Set Variable](/nodes/data/variable/set-variable) node to update tha value of a **Variable**. In this case, you control when the value is stored by sending a signal to the <span className="ndl-signal">Do</span> action.
|
||||
|
||||
## Use a stored value
|
||||
|
||||
When a value is stored in a variable you can use it somewhere else in your application simply be creating a new node and giving it the same **Name** and connecting the **Value** property.
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Name</span> | <##input:name##>The name of the **Variable**. All **Variable** nodes with the same name will share the same data.<##input##> |
|
||||
| <span className="ndl-data">Value</span> | <##input:value##>The value that you want the **Variable** to get. You will connect your data to this input. The value of the **Variable** will change when the data changes. If you want to control more precisely when the value should be updated, you should use the [Set Variable](/nodes/data/variable/set-variable) node.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Fetch</span> | <##input:fetch##>Normally the value output of the node is updated once the **Name** input is set and if there is a change in the data from somewhere in the graph. However, if this signal has a connection it will wait until it gets a signal on **Fetch** before it updates.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Value</span> | <##output:value##>The current value of this **Variable** node.<##output##> |
|
||||
| <span className="ndl-data">Name</span> | <##output:name##>The name of the **Variable**.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Changed</span> | <##output:changed##>This signal is sent when the **Value** of this **Variable** has changed. Note: The signal triggers when any **Variable** with the same **Name** is changed, i.e. it triggers when the underlying data has changed.<##output##> |
|
||||
| <span className="ndl-signal">Fetched</span> | <##output:fetched##>Signal when the data of this **Variable** node has been fetched and updated, either as a response to the **Fetch** input signal (when it has completed and the output **Value** is updated), or when the **Name** of the variable have changed.<##output##> |
|
||||
Reference in New Issue
Block a user