framework
- Version 0.6.0
- Published
- 77.7 kB
- 2 dependencies
- MIT license
Install
npm i framework
yarn add framework
pnpm add framework
Overview
Framework for TypeScript applications
Index
Functions
function contract
contract: < Properties extends string, Page extends Record<Properties, unknown>>(config: { page: Page; model: Pick<Page, KeysOfEffectorApi<Page>>;}) => void;
function createBrowserApplication
createBrowserApplication: (config: { ready: Event<void>; routes: RouteConfig[]; domain?: Domain;}) => { navigation: { history: history.History<unknown>; historyPush: effector.Effect<string, void, Error>; historyPushSearch: effector.Effect<string, void, Error>; historyReplace: effector.Effect<string, void, Error>; historyChanged: Event<HistoryChange>; historyEmitCurrent: Event<void>; $redirectTo: effector.Store<string>; };};
function createHatch
createHatch: (config_?: Config | Domain) => Hatch;
Events here is an input signal, history should call them when route enters, updates, and exits. Stores is derived from this events and holds specific parameters
$opened
holds current state of page, if user visited page but not left, it istrue
function createPages
createPages: (routes: RouteConfig[]) => JSX.Element;
function getHatch
getHatch: <T extends React.ComponentType<any>>( component: T) => Hatch | undefined;
function lookupHatch
lookupHatch: <P>(match: MatchedRoute<P>) => Hatch | undefined;
function withHatch
withHatch: <C extends React.ComponentType>(hatch: Hatch, component: C) => C;
Interfaces
interface Hatch
interface Hatch {}
Hatch is like a Gate, but just for models
property $opened
$opened: Store<boolean>;
property $params
$params: Store<Record<string, string>>;
property $props
$props: Store<HatchParams>;
property $query
$query: Store<Record<string, string>>;
property enter
enter: Event<HatchParams>;
property exit
exit: Event<void>;
property update
update: Event<HatchParams>;
interface HatchParams
interface HatchParams {}
Package Files (1)
Dependencies (2)
Dev Dependencies (60)
- @babel/cli
- @babel/core
- @babel/plugin-proposal-class-properties
- @babel/plugin-proposal-nullish-coalescing-operator
- @babel/plugin-proposal-object-rest-spread
- @babel/plugin-proposal-optional-chaining
- @babel/plugin-transform-react-constant-elements
- @babel/plugin-transform-runtime
- @babel/preset-env
- @babel/preset-react
- @babel/preset-typescript
- @commitlint/cli
- @commitlint/config-conventional
- @eslint-kit/eslint-config-base
- @eslint-kit/eslint-config-node
- @eslint-kit/eslint-config-prettier
- @eslint-kit/eslint-config-react
- @eslint-kit/eslint-config-typescript
- @rollup/plugin-babel
- @rollup/plugin-commonjs
- @rollup/plugin-node-resolve
- @testing-library/dom
- @testing-library/react
- @testing-library/user-event
- @types/debug
- @types/history
- @types/jest
- @types/loadable__component
- @types/node
- @types/react
- @types/react-dom
- @types/react-router
- @types/react-router-config
- @types/react-router-dom
- @typescript-eslint/parser
- babel-jest
- babel-plugin-module-resolver
- commitizen
- cz-conventional-changelog
- effector
- eslint
- history
- husky
- import-sort-style-sova
- jest
- lint-staged
- patronum
- prettier
- prettier-plugin-import-sort
- react
- react-dom
- react-is
- react-router
- react-router-config
- react-router-dom
- rollup
- rollup-plugin-dts
- rollup-plugin-terser
- ts-node
- typescript
Peer Dependencies (5)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/framework
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/framework)
- HTML<a href="https://www.jsdocs.io/package/framework"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1374 ms. - Missing or incorrect documentation? Open an issue for this package.