This commit is contained in:
crusader 2017-07-19 18:25:56 +09:00
parent 820e57f555
commit 042df27112
6 changed files with 37 additions and 20 deletions

View File

@ -34,14 +34,14 @@ function* app(): any {
sagaMiddleware.run(sagas); sagaMiddleware.run(sagas);
// ReactDOM.render( ReactDOM.render(
// <Provider store={store}> <Provider store={store}>
// <ConnectedRouter history={history}> <ConnectedRouter history={history}>
// {routes} {routes}
// </ConnectedRouter> </ConnectedRouter>
// </Provider>, </Provider>,
// appContainer, appContainer,
// ); );
} }
sagaMiddleware.run(app); sagaMiddleware.run(app);

View File

@ -1,13 +1,22 @@
import * as React from 'react'; import * as React from 'react';
import { RouteComponentProps } from 'react-router'; import { RouteComponentProps } from 'react-router';
import SignInContainer from '@overflow/member/react/SignIn'; import SignInContainer from '@overflow/member/react/SignIn';
import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC';
import inject from '@overflow/commons/context/decorator/inject';
class Signin extends React.Component<RouteComponentProps<object>, object> { class Signin extends React.Component<RouteComponentProps<object>, object> {
@inject()
private client: WebSocketRPC;
public render(): JSX.Element { public render(): JSX.Element {
return ( return (
<SignInContainer/> <SignInContainer/>
); );
} }
private test(@inject() c: WebSocketRPC): void {
console.log('');
}
} }

View File

@ -0,0 +1,19 @@
import * as METADATA from './constants';
const inject = <TFunction extends Function>(type?: TFunction) => {
return (target: Object, propertyKey: string | symbol, parameterIndex?: number): void => {
if (typeof parameterIndex === 'number') {
// tagParameter(target, targetKey, index, metadata);
} else {
let types = Reflect.getMetadata('design:type', target, propertyKey);
let aaa = type;
console.log(aaa);
// tagProperty(target, targetKey, metadata);
}
};
};
export default inject;

View File

@ -1,11 +0,0 @@
import * as METADATA from './constants';
const inject = <TFunction extends Function>(type: TFunction) => {
return (target: Object, propertyKey: string | symbol, parameterIndex?: number): void => {
console.log('');
};
};
export default inject;

View File

@ -9,7 +9,7 @@ import {
RPCRequest, RPCRequest,
RPCResponse, RPCResponse,
} from './protocol/rpc'; } from './protocol/rpc';
import { injectable } from 'inversify'; import injectable from '../context/decorator/injectable';
export type OnConnectFunc = () => void; export type OnConnectFunc = () => void;
export type OnDisconnectFunc = () => void; export type OnDisconnectFunc = () => void;