Options
All
  • Public
  • Public/Protected
  • All
Menu

seas-react-boilerplate

Index

Variables

Const App

App: FunctionComponent<__type> = hot(ColdApp)

Const HUID

HUID: "88888888" = "88888888"

An 8-character numeric string representing a Harvard ID

Const MessageContext

MessageContext: Context<Function> = createContext(null)

Global message provider

SERVER_PORT

SERVER_PORT: string

Const UserContext

UserContext: Context<UserResponse> = createContext(null)

Manage the currently logged-in user throught Context

Const array

array: string[] = ['Life', 'Universe', 'Everything']

An array of strings

Const compiler

compiler: MultiCompiler = webpack([{name: 'client',target: 'web',mode: 'development',devtool: 'cheap-eval-source-map',entry: ['webpack-hot-middleware/client','react-hot-loader/patch','./src/client/index.ts',],output: {path: resolve(__dirname, 'build/static'),filename: 'app.js',publicPath,},module: {rules: [{test: /\.tsx?$/,exclude: /node_modules/,use: [{loader: 'babel-loader',options: {plugins: ['react-hot-loader/babel'],},},'ts-loader',],},],},resolve: {extensions: ['.ts', '.tsx', '.js', '.jsx'],alias: {'react-dom': '@hot-loader/react-dom',},plugins: [new TSConfigPathsPlugin(),],},plugins: [new HtmlWebpackPlugin({title: process.env.APP_NAME,}),new HtmlWebpackRootPlugin(),new webpack.HotModuleReplacementPlugin(),],}])

Configures react development for the client.

Const devServer

devServer: WebpackDevMiddleware & function = webpackDevServer(compiler, {publicPath,})

Implements the webpack development server middleware to server Compiled client code from memory. The Hot Server also allows for live module replacement.

Const email

email: "help@seas.harvard.edu" = "help@seas.harvard.edu"

A string representing an email address

Const error

error: Error = new Error('Error')

An error

Const hotServer

hotServer: function & EventStream = webpackHotServer(compiler)

Const int

int: 42 = 42

An integer

Const publicPath

publicPath: "/" = "/"

Const regularUser

regularUser: User = new User({firstName: 'Regular',lastName: 'User',eppn: '4A2849CF119852@harvard.edu',email: 'test@seas.harvard.edu',})

Const safeString

safeString: "dont-panic" = "dont-panic"

A single string with no spaces or special characters

Const string

string: "Don't Panic" = "Don't Panic"

A single string

Const year

year: 2018 = 2018

A single number representing a year

Functions

Const ColdApp

  • ColdApp(): ReactElement
  • The primary app component. Fetches the current user from the server when it mounts, then saves it to the UserContext to pass down to other components

    Returns ReactElement

Const Message

  • Message(__namedParameters: object): ReactElement

bootstrap

  • bootstrap(): Promise<void>

Const getCurrentUser

Const messageReducer

Generated using TypeDoc