Repository URL to install this package:
|
Version:
0.0.3 ▾
|
/**
* @todo fix type
*/
import { ObservableMap } from 'xmobx/mobx'
/**
* @todo connect to routing too
*
* @todo split smaller stores (loading, snackbar, scroll, resize)
* @see https://mobx.js.org/best/store.html
* can do focus here too probably & locale
*
* @todo can use context here to show & set popups & modal & snackbar...
*/
export interface ApplicationScreen {
height: number
width: number
availHeight: number
availWidth: number
isGrowing?: boolean
isShrinking?: boolean
}
export interface ApplicationScroll {
vertical: number
horizontal: number
direction: 'up' | 'down' | 'none' | string
}
export interface ApplicationPrev {
screen: {
height: number
width: number
}
}
export interface ApplicationSnackbar {
isVisible?: boolean
message?: string
meta?: any
}
export interface ApplicationTypes {
store: ObservableMap
hasError: boolean
/**
* @todo @name snackBar
*/
snackbar: ApplicationSnackbar
// router....
// not observable previous => snapshot
prev: ApplicationPrev
screen: ApplicationScreen
scroll: ApplicationScroll
}
export type CurriedSet<Type = any> = (x: any) =>
Type & ApplicationTypes