Class
StoragePlugin
View sourceExtendsPlugin
Adds browser storage resources to an App.
The plugin provides fresh Session, Storage, and
Cookies resources for application code. Use them for tab-scoped
values, origin-scoped values, and document cookies respectively.
StoragePlugin requires CorePlugin and
ReflectPlugin. Register these dependencies before the storage
plugin; plugin dependencies are checked but are not installed automatically.
Examples
import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { ReflectPlugin } from '@wimaengine/reflect'
import { Session, StoragePlugin } from '@wimaengine/storage'
const app = new App()
app
.registerPlugin(new ReflectPlugin())
.registerPlugin(new CorePlugin())
.registerPlugin(new StoragePlugin())
.run()
// Access the resources from an app world.
function saveScreen(world) {
world.getResource(Session).set('screen', 'home')
}Constructor
Methods
register(app: App): void
View sourcerequires(): TypeId[]
View sourceReturns the plugin IDs required by StoragePlugin.
Register CorePlugin and ReflectPlugin before this
plugin. Registering StoragePlugin does not install them
automatically.
