Methods
info
Here are valuable methods of the Agile Class
listed.
createState()
warning
createCollection()
warning
createComputed()
warning
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
Prop | Type | Default | Description | Required |
---|---|---|---|---|
integration | Integration | undefined | Integration that gets registered/integrated into AgileTs | Yes |
📄 Return
Agile
Returns the Agile Instance it was called from
hasIntegration()
Checks whether AgileTs has any registered Framework Integration.
📄 Return
boolean
createStorage()
warning
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 });