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 {IBaseProtocol} from 'pg-promise'; | |
| import cfg from '../app-config'; | |
| import * as pgp from 'pg-promise'; | |
| import * as types from './admin-api-types'; | |
| import {Auth} from './auth'; | |
| import {InvalidRequest, AccessDenied} from './errors'; | |
| import * as path from 'path'; | |
| const requestTypes:string[] = types.RequestT.types.map(rt => rt.props.type.value); | |
| const sql:{[requestType:string]:pgp.QueryFile} = {}; |
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 t from 'io-ts'; | |
| function request<P extends t.Props>(type:string, props:P) { | |
| return t.type({ | |
| type: t.literal(type), | |
| props: t.type(props) | |
| }); | |
| } | |
| export const RequestT = t.union([ | |
| request('foo', { | |
| baz: t.string, |
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 React from 'react'; | |
| import {appConnect, createPropsMapper, PropsOf} from './app-connect'; | |
| import {RootState} from '../reducers'; | |
| import { | |
| getPlayers, | |
| setCurrentTime, | |
| setBuffered, | |
| setNextPlaying, | |
| setPlaying, | |
| setSeekTime, |
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
| interface SetGet<A,V> { | |
| setValue: (o:A, v:V) => A; | |
| getValue: (o:A) => V; | |
| } | |
| function f<A>(k:keyof A):SetGet<A, A[typeof k]> { | |
| return { | |
| setValue: (a:A, v:A[typeof k]) => Object.assign({}, a, {[k]: v}), | |
| getValue: (a:A) => a[k] |
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
| function f<A>(k:keyof A) { | |
| return { | |
| setValue: (a:A, v:A[typeof k]) => Object.assign({}, a, {[k]: v}), | |
| getValue: (a:A) => a[k] | |
| }; | |
| } | |
| interface B { | |
| s: string; | |
| n: number; |
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 {connect} from 'react-redux'; | |
| import {Dispatch, bindActionCreators, ActionCreatorsMapObject} from 'redux'; | |
| import {createStandardAction} from 'typesafe-actions'; | |
| import React from 'react'; | |
| interface RootState { | |
| counters: { | |
| [name: string]: {count: number}; | |
| }; | |
| } | |
| const actions = { |
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 {connect} from 'react-redux'; | |
| import {bindActionCreators, ActionCreatorsMapObject} from 'redux'; | |
| import {RootState, Dispatch} from '../reducers'; | |
| export interface PropsMapper<StateProps, DispatchProps, OwnProps> { | |
| fromState: (state:RootState, ownProps:OwnProps) => StateProps; | |
| actions: (ownProps:OwnProps) => DispatchProps; | |
| } | |
| export type PropsOf<T> = T extends PropsMapper<infer StateProps, infer DispatchProps, infer OwnProps> |
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 React from 'react'; | |
| class LinkClickTracker extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| componentDidMount() { | |
| const {onClickLink} = this.props; | |
| Array.from(this.refs.div.querySelectorAll('a')).forEach(a => { | |
| a.onclick = async e => { |
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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "outDir": "../../dist/frontend", | |
| "sourceMap": true, | |
| "esModuleInterop": true, | |
| "noImplicitAny": true, | |
| "strict": true, | |
| "module": "commonjs", | |
| "target": "es5", | |
| "jsx": "react", |
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
| 'use strict'; | |
| var path = require('path') | |
| , webpack = require('webpack') | |
| , HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| var proxySettings = { | |
| '/api/*': { | |
| target: 'http://localhost:3000', | |
| pathRewrite: { |