Cleaning up os 'app' launching, apps always return a function that takes a size for their window
This commit is contained in:
parent
12a22cf55c
commit
eccc14a714
4 changed files with 22 additions and 16 deletions
|
|
@ -41,7 +41,7 @@ export const _rt = {
|
|||
clip: (config: any) => ({ kind: 'clip', ...config }),
|
||||
opacity: (config: any) => ({ kind: 'opacity', ...config }),
|
||||
stateful: (config: any) => ({ kind: 'stateful', ...config }),
|
||||
measure: (config: any) => ({ kind: 'measure', ...config }),
|
||||
measure: measure,
|
||||
measureText: (text: string) => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
|
@ -53,8 +53,6 @@ export const _rt = {
|
|||
},
|
||||
},
|
||||
|
||||
measure: measure,
|
||||
|
||||
batch: (events: any[]) => ({ _tag: 'Batch', _0: events }),
|
||||
noOp: { _tag: 'NoOp' },
|
||||
focus: (key: string) => ({ _tag: 'Focus', _0: key }),
|
||||
|
|
@ -95,6 +93,7 @@ export const _rt = {
|
|||
hasField: (field: string) => (obj: any) => ({
|
||||
_tag: (typeof obj === 'object' && obj !== null && field in obj) ? 'True' : 'False'
|
||||
}),
|
||||
isFunction: (v: any) => ({ _tag: typeof v === 'function' ? 'True' : 'False' }),
|
||||
storeSearch: (query: string) => {
|
||||
return Object.keys(store)
|
||||
.filter(name => _rt.fuzzyMatch(query)(name)._tag === 'True')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue