uralsjs-spa-app
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

uralsjs-spa-app

Single page application

API

/**
 * Action after reneder element
 */
export type AfterRenderFunc<State> = (
    htmlEl: HTMLElement,
    state: State,
    id: string|number
) => void;

/**
 * Runs SPA by modelsets and after-render functions.
 * Theese parameters should be same keys Record
 */
export const spaApp = <Keys extends string, Id>(
    modelSets: Record<Keys, ModelSet<unknown, unknown>>,
    afterRender: Record<Keys, AfterRenderFunc<Record<Keys, ReactiveStorage<unknown, unknown>>>>
) : void

Example

See ts/test folder

Author

Anaroly Starodubtsev tostar74@mail.ru

License

MIT

Package Sidebar

Install

npm i uralsjs-spa-app

Weekly Downloads

1

Version

0.1.4

License

MIT

Unpacked Size

35.2 kB

Total Files

33

Last publish

Collaborators

  • pantagruel74