store
@rotorsoft/act-root / act/src / store
Variable: store
conststore: (adapter?) =>Store
Defined in: libs/act/src/ports.ts:169
Gets or injects the singleton event store.
By default, Act uses an InMemoryStore suitable for development and
testing. For production, inject a persistent store like PostgresStore from
@rotorsoft/act-pg before building your application.
Important: Store injection must happen before creating any Act instances. Once set, the store cannot be changed without restarting the application.
Parameters
adapter?
Optional store implementation to inject
Returns
The singleton store instance
Examples
import { store } from "@rotorsoft/act";
const s = store();
import { store } from "@rotorsoft/act";
import { PostgresStore } from "@rotorsoft/act-pg";
store(new PostgresStore({
host: "localhost",
port: 5432,
database: "myapp",
user: "postgres",
password: "secret",
}));
See
- Store for the interface contract
- InMemoryStore for the default implementation