Skip to main content

Methods

❗️info

Here are valuable methods of the Agile Class listed.

createState()

🔥warning

The createState() method has been deprecated in the latest version ^0.2.0 and is no longer available!

Why?

Optimizing tree shaking support.

Alternative?

import {createState} from "@agile-ts/core";

createState('jeff', {agileInstance: App});



createCollection()

🔥warning

The createCollection() method has been deprecated in the latest version ^0.2.0 and is no longer available!

Why?

Optimizing tree shaking support.

Alternative?

import {createCollection} from "@agile-ts/core";

createCollection({}, {agileInstance: App});



createComputed()

🔥warning

The createComputed() method has been deprecated in the latest version ^0.2.0 and is no longer available!

Why?

Optimizing tree shaking support.

Alternative?

import {createComputed} from "@agile-ts/core";

createComputed(() => {}, {agileInstance: App});



integrate()

Integrates a Framework Integration into AgileTs. An Integration simply tells AgileTs, how to mutates a particular Component whenever a State changes. In order to bind States to UI-Components and thus be reactive, any Framework using AgileTs needs an Integration for AgileTs. For example, to use AgileTs in a React environment, we have to integrate/register the React Integration.

App.integrate(reactIntegration);

📭 Props

PropTypeDefaultDescriptionRequired
integrationIntegrationundefinedIntegration that gets registered/integrated into AgileTsYes

📄 Return

Agile

Returns the Agile Instance it was called from




hasIntegration()

Checks whether AgileTs has any registered Framework Integration.

📄 Return

boolean



createStorage()

🔥warning

The createStorage() method has been deprecated in the latest version ^0.2.0 and is no longer available!

Why?

Optimizing tree shaking support.

Alternative?

import {createStorage} from "@agile-ts/core";

createStorage({/* config */});



registerStorage()

🔥warning

The registerStorage() method has been deprecated in the latest version ^0.2.0 and is no longer available!

Why?

Optimizing tree shaking support.

Alternative?

A storage can now be registered with the shared Storage Manager, which manages all Storages for AgileTs.

import {getSharedStorageManager, createStorage} from "@agile-ts/core";

// Create an interface to the Local Storage
const _localStorage = createStorage({
key: 'localStorage',
async: false,
methods: {
get: localStorage.getItem.bind(localStorage),
set: localStorage.setItem.bind(localStorage),
remove: localStorage.removeItem.bind(localStorage),
},
});

// Register Storage to the shared Storage Manager
getSharedStorageManager().register(_localStorage, { default: true });



hasStorage()

🔥warning

The hasStorage() method has been deprecated in the latest version ^0.2.0 and is no longer available!

Why?

Optimizing tree shaking support.

Alternative?

import {getSharedStorageManager} from "@agile-ts/core";

getSharedStorageManager().hasStorage()