This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable, SubscribableOrPromise } from "rxjs" | |
| import { switchMap, tap } from "rxjs/operators" | |
| export type collectedResponse<T2> = { loading: boolean; error: null | Error; value: null | T2 } | |
| export function collectResponse<T1, T2>(performRequest: (t1: T1) => SubscribableOrPromise<T2>) { | |
| return (observer: Observable<T1>)=>{ | |
| let lastResponse = null as null | T2 | |
| return new Observable<collectedResponse<T2>>(subscriber=>{ | |
| return observer.pipe( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.servicemap = new Map() | |
| class A { | |
| constructor(){ | |
| console.log("A created") | |
| } | |
| } | |
| function useService(A){ | |
| let a = servicemap.get(A) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * some insane hack, just want to avoid using expensive parser. | |
| */ | |
| export function getFreeVariables(expr:string, knownSymbols:Record<string,unknown>){ | |
| const freeVariables = new Set<string>(); | |
| //eslint-disable-next-line | |
| const anyThingPrimitive = ()=>{}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| createProgram, | |
| SourceFile, | |
| isImportDeclaration, | |
| createCompilerHost, | |
| CompilerOptions, | |
| ModuleKind, | |
| ModuleResolutionKind, | |
| ScriptTarget, | |
| resolveModuleNameFromCache, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from "react"; | |
| const ERROR_DETAIL = Symbol("errors") | |
| const HAS_ERROR = Symbol("has error") | |
| const InternalSymbolKeys = [ERROR_DETAIL,HAS_ERROR] | |
| enum FieldType { | |
| arrayItem, | |
| property, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createBrowserHistory } from "history"; | |
| import { BehaviorSubject } from 'rxjs'; | |
| import * as React from "react" | |
| type RouteConfig<P=any> = { | |
| key:string, | |
| label?:string, | |
| icon?:string, | |
| component?:()=>Promise<{default:React.ComponentType<P>}>, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function $exportCSV(csv, filename) { | |
| const blobObject = new Blob(["\ufeff", csv], { | |
| type: "text/csv;charset=utf-8;" | |
| }); | |
| // Internet Explorer | |
| if (navigator.msSaveOrOpenBlob) { | |
| navigator.msSaveOrOpenBlob(blobObject, filename); | |
| } else { | |
| // Chrome |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by buhi on 2017/7/11. | |
| */ | |
| import * as React from "react" | |
| import {Grid,GridFieldSchema,GridProps} from "ag-grid-material-preset"; | |
| import {IGetRowsParams} from "ag-grid/dist/lib/rowModels/iDatasource"; | |
| import {GridApi} from "ag-grid/dist/lib/gridApi"; | |
| import {List,Repeat} from "immutable"; | |
| type InfiniteScrollGridProps = { |
NewerOlder