Creating an application
A zoram application is entirely described by the list of plugins you pass to the createApp
function, they will implement all of your applicative and business logic.
That means that you can create multiple applications with a set of predefined plugins but have complete control on what feature is available, this makes it easy to tailor a specific application to the needs of a product, client, project or team.
import {createApp} from '@zoram/core';
createApp([/* your plugins goes here */]);
Using multiple apps
An application provides a self-contained context to the plugins that defines it, that allow you to have more than one app per environment or even to use apps within apps. You can for example use zoram to configure a Tiptap editor, build an Astro dynamic island, create a complete Progressive Web App or all that at once.
And because plugins are reusable you can use them across multiple applications to avoid re-inventing the wheel over and over again.
import {createApp} from '@zoram/core';
import {plugins as productPlugins} from 'my-awsome-product';
import {plugins as headerMenuPlugins} from 'website/header';
import {plugins as analiticsPlugins} from 'sales/analitics';
const product = createApp([
...productPlugins,
...analiticsPlugins
]);
const headerMenu = createApp([
...headerMenuPlugins,
...analiticsPlugins
]);
Identifying an app
You might find yourself in situations where you have two or more application sharing the same global context, debugging in such a case can get annoying if you don't have a way of telling the instances apart, this can be remedied by providing an id
to the createApp
function that will be shown in the dev tools and the logs of the application.
import {createApp} from '@zoram/core';
const app = createApp(
[ /* your plugins goes here */],
{
id: 'myApp'
}
);