Model

interface Model<InitOptions, Universe, ActionCtx, ViewCtx>;

Stores all types and plugins used in your app. Created with createModel.

Example

const model = createModel<State>();

Methods

with(plugin)

Adds a plugin to the model. Returns a new model.

Usage

import { createModel } from "@prodo/core";
import logger from "@prodo/logger";
const model = createModel<State>().with(logger);

createStore(config)

Create a Store and Provider. Takes in initial state and all config needed for plugin.

Usage

import { model } from "./model";
const { store, Provider } = model.createStore({
initState: {
count: 0
}
});