mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
34 lines
838 B
JavaScript
34 lines
838 B
JavaScript
import { createNodeModule } from "../../nodeTypes.js";
|
|
|
|
/**
|
|
* Opens persistent cartridge storage using cartdata.
|
|
*/
|
|
export const cartdataNode = createNodeModule(
|
|
{
|
|
id: "data_cartdata",
|
|
title: "Cart Data Init",
|
|
category: "Data",
|
|
description: "Setup persistent storage for the cartridge using CARTDATA().",
|
|
searchTags: ["cartdata", "save", "persistent", "data"],
|
|
inputs: [
|
|
{
|
|
id: "id",
|
|
name: "Identifier",
|
|
direction: "input",
|
|
kind: "string",
|
|
defaultValue: "\"my_cart\"",
|
|
},
|
|
],
|
|
outputs: [
|
|
{ id: "loaded", name: "Loaded", direction: "output", kind: "boolean" },
|
|
],
|
|
properties: [],
|
|
},
|
|
{
|
|
evaluateValue: ({ resolveValueInput }) => {
|
|
const id = resolveValueInput("id", '"pico_cart"');
|
|
return `cartdata(${id})`;
|
|
},
|
|
}
|
|
);
|