ing
This commit is contained in:
parent
820e57f555
commit
042df27112
|
@ -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);
|
||||||
|
|
|
@ -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('');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
19
src/ts/@overflow/commons/context/decorator/inject.ts
Normal file
19
src/ts/@overflow/commons/context/decorator/inject.ts
Normal 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;
|
|
@ -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;
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user