-
src/
- app/
All your frontend stuff / entry points
Anothing that is not frontend
- app/
-
public/
index.html
- build/
all your frontend bundles
-
images/
This file contains 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
console.log('Executing foo'); | |
let foo = 'hello'; | |
export const setFoo = (value)=> foo = value; | |
export const getFoo = ()=> foo; |
This file contains 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
const { FuseBox } = require('fuse-box'); | |
const fsbx = require('fuse-box'); | |
const box = FuseBox | |
.init({ | |
tsConfig: "tsconfig.json", | |
homeDir: "src/", | |
sourceMap: { | |
bundleReference: "sourcemaps.js.map", | |
outFile: "public/build/sourcemaps.js.map", |
This file contains 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 interface Check { | |
/** If a message is returned it is used to prevent a nav away */ | |
(): string | null | undefined; | |
} | |
/** Checks we need to do before leave */ | |
let checks: Check[] = []; | |
/** Only alert in browsers */ | |
if (typeof window !== 'undefined') { |
This file contains 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"; | |
import * as ReactDOM from 'react-dom' | |
const Tether = require('tether'); | |
import { PropTypes, Children } from 'react'; | |
const renderElementToPropTypes = [ | |
PropTypes.string, | |
PropTypes.shape({ | |
appendChild: PropTypes.func.isRequired | |
}) |
This file contains 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
/** | |
* Quick array equal | |
*/ | |
export function arraysEqual<T>(a: T[], b: T[]): boolean { | |
if (a === b) return true; | |
if (a == null || b == null) return false; | |
if (a.length != b.length) return false; | |
for (var i = 0; i < a.length; ++i) { | |
if (a[i] !== b[i]) return false; |
This file contains 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 interface Listener<T> { | |
(event: T): any; | |
} | |
export interface Disposable { | |
dispose(); | |
} | |
/** passes through events as they happen. You will not get events from before you start listening */ | |
export class TypedEvent<T> { |
This file contains 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 | |
const assert = require("chai").assert; | |
// later | |
assert(something, "some message"); |
This file contains 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
/** | |
* Utility : Resolves when a script has been loaded | |
*/ | |
function include(url: string) { | |
return new Promise<{ script: HTMLScriptElement }>((resolve, reject) => { | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = url; | |
script.onload = function() { |
This file contains 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
/** | |
* @module Maintains a single stylesheet and keeps it in sync with requested styles | |
*/ | |
import * as FreeStyle from "free-style"; | |
import * as React from "react"; | |
/** Just for autocomplete convinience */ | |
export interface CSSProperties extends React.CSSProperties { | |
'&:hover'?: CSSProperties; | |
'&:active'?: CSSProperties; |