mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
34 lines
766 B
JavaScript
34 lines
766 B
JavaScript
import { createNodeModule } from "../../nodeTypes.js";
|
|
|
|
/**
|
|
* Reads a persistent value using dget.
|
|
*/
|
|
export const dgetNode = createNodeModule(
|
|
{
|
|
id: "data_dget",
|
|
title: "Data Get",
|
|
category: "Data",
|
|
description: "Retrieve a persistent number using DGET().",
|
|
searchTags: ["dget", "load", "data", "persistent"],
|
|
inputs: [
|
|
{
|
|
id: "index",
|
|
name: "Index",
|
|
direction: "input",
|
|
kind: "number",
|
|
defaultValue: 0,
|
|
},
|
|
],
|
|
outputs: [
|
|
{ id: "value", name: "Value", direction: "output", kind: "number" },
|
|
],
|
|
properties: [],
|
|
},
|
|
{
|
|
evaluateValue: ({ resolveValueInput }) => {
|
|
const index = resolveValueInput("index", "0");
|
|
return `dget(${index})`;
|
|
},
|
|
}
|
|
);
|