1 line
2.9 KiB
JavaScript
1 line
2.9 KiB
JavaScript
import{_ as t,c as a,a0 as r,o as s}from"./chunks/framework.P9qPzDnn.js";const u=JSON.parse('{"title":"Function: persistent()","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/game/persistence/functions/persistent.md","filePath":"api/game/persistence/functions/persistent.md","lastUpdated":null}'),n={name:"api/game/persistence/functions/persistent.md"};function o(i,e,c,d,l,p){return s(),a("div",null,e[0]||(e[0]=[r('<p><a href="./../../../">Profectus</a> / <a href="./../">game/persistence</a> / persistent</p><h1 id="function-persistent" tabindex="-1">Function: persistent() <a class="header-anchor" href="#function-persistent" aria-label="Permalink to "Function: persistent()""></a></h1><blockquote><p><strong>persistent</strong><<code>T</code>>(<code>defaultValue</code>, <code>checkNaN</code>): <a href="./../type-aliases/Persistent"><code>Persistent</code></a><<code>T</code>></p></blockquote><p>Create a persistent ref, which can be saved and loaded. All (non-deleted) persistent refs must be included somewhere within the layer object returned by that layer's options func.</p><h2 id="type-parameters" tabindex="-1">Type Parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to "Type Parameters""></a></h2><p>• <strong>T</strong> <em>extends</em> <a href="./../type-aliases/State"><code>State</code></a></p><h2 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h2><h3 id="defaultvalue" tabindex="-1">defaultValue <a class="header-anchor" href="#defaultvalue" aria-label="Permalink to "defaultValue""></a></h3><p>The value the persistent ref should start at on fresh saves or when reset.</p><p><code>T</code> | <a href="https://vuejs.org/guide/typescript/composition-api.html#typing-ref" target="_blank" rel="noreferrer"><code>Ref</code></a><<code>T</code>, <code>T</code>></p><h3 id="checknan" tabindex="-1">checkNaN <a class="header-anchor" href="#checknan" aria-label="Permalink to "checkNaN""></a></h3><p><code>boolean</code> = <code>true</code></p><p>Whether or not to check this ref for being NaN on set. Only use on refs that should always be DecimalSources.</p><h2 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h2><p><a href="./../type-aliases/Persistent"><code>Persistent</code></a><<code>T</code>></p><h2 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to "Defined in""></a></h2><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/persistence.ts#L131" target="_blank" rel="noreferrer">profectus/src/game/persistence.ts:131</a></p>',17)]))}const f=t(n,[["render",o]]);export{u as __pageData,f as default};
|