I hereby claim:
- I am lucavgobbi on github.
- I am lucavgobbi (https://keybase.io/lucavgobbi) on keybase.
- I have a public key ASCdBjhCg4BpLUSEbfgk8Yuyl75uYyqg59hq40rKf0wQ5Qo
To claim this, I am signing this object:
//https://goo.gl/wrJXHJ | |
const webpack = require("webpack"); | |
module.exports = { | |
entry: "./src/index.tsx", | |
output: { | |
filename: "./Scripts/bundle.js" | |
}, | |
devtool: "source-map", |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>SignalR Simple Chat</title> | |
<style type="text/css"> | |
.container { | |
background-color: #99CCFF; | |
border: thick solid #808080; | |
padding: 20px; | |
margin: 20px; |
let _hub; | |
let store = createStore( | |
todoApp, | |
// applyMiddleware() tells createStore() how to handle middleware | |
applyMiddleware(signalRMiddleware) | |
) | |
// Make sure signalr is connected | |
signalRStart(store, () => { |
export function signalRStart(store: any, callback: Function) { | |
_hub = $.connection.myHubName; | |
_hub.client.firstClientFunction = (p1: any) => { | |
store.dispatch({ type: "SERVER_CALLED_ME", a: p1 }); | |
} | |
_hub.client.secondClientFunction = (p1: string, p2: string) => { | |
store.dispatch({ type: "SERVER_CALLED_ME_2", value: p1 + p2 }); | |
} |
export function signalRMiddleware(store: any) { | |
return (next: any) => (action: any) => { | |
if (action.signalR) { | |
switch (action.type) { | |
case ABC: | |
_hub.server.methodOnTheServer(); | |
break; | |
default: | |
{ | |
const myCurrentState = store.getState().objectWithinState; |
I hereby claim:
To claim this, I am signing this object:
import * as React from "react"; | |
import * as ReactDOM from "react-dom"; | |
import { Well } from "./components/well"; | |
ReactDOM.render( | |
<div> | |
<Well text="Well well well..."/> | |
</div>, | |
document.getElementById("body") | |
); |
import * as React from "react"; | |
export interface IWellProps { | |
text: string | |
} | |
export class Well extends React.Component<IWellProps, {}> { | |
render() { | |
return <div className="well">{this.props.text}</div>; | |
} |
module.exports = { | |
entry: "./Scripts/src/index.tsx", | |
output: { | |
filename: "./Scripts/dist/bundle.js", | |
}, | |
// Enable sourcemaps for debugging webpack's output. | |
devtool: "source-map", | |
resolve: { |
{ | |
"compilerOptions": { | |
"outDir": "./Scripts/", | |
"sourceMap": true, | |
"noImplicitAny": true, | |
"module": "commonjs", | |
"target": "es5", | |
"jsx": "react" | |
}, | |
"exclude": [ |