profectus-docs/assets/api_game_persistence_functions_persistent.md.dXuCUiHJ.lean.js

1 line
2.9 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 &quot;Function: persistent()&quot;"></a></h1><blockquote><p><strong>persistent</strong>&lt;<code>T</code>&gt;(<code>defaultValue</code>, <code>checkNaN</code>): <a href="./../type-aliases/Persistent"><code>Persistent</code></a>&lt;<code>T</code>&gt;</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&#39;s options func.</p><h2 id="type-parameters" tabindex="-1">Type Parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to &quot;Type Parameters&quot;"></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 &quot;Parameters&quot;"></a></h2><h3 id="defaultvalue" tabindex="-1">defaultValue <a class="header-anchor" href="#defaultvalue" aria-label="Permalink to &quot;defaultValue&quot;"></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>&lt;<code>T</code>, <code>T</code>&gt;</p><h3 id="checknan" tabindex="-1">checkNaN <a class="header-anchor" href="#checknan" aria-label="Permalink to &quot;checkNaN&quot;"></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 &quot;Returns&quot;"></a></h2><p><a href="./../type-aliases/Persistent"><code>Persistent</code></a>&lt;<code>T</code>&gt;</p><h2 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to &quot;Defined in&quot;"></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};