mirror of
https://github.com/bendtherules/ts-transformer-visualizer.git
synced 2026-08-18 13:51:48 +00:00
index - Export all components inside ASTVisualizer and connected redux actions
This commit is contained in:
+30
-14
@@ -3,26 +3,42 @@
|
||||
*/
|
||||
|
||||
import * as React from "react";
|
||||
import { bindActionCreators } from "redux";
|
||||
import { Provider } from "react-redux";
|
||||
|
||||
import ASTOutline from "./components/ASTOutline";
|
||||
import {
|
||||
CodeOutputForInitial,
|
||||
CodeOutputForCurrent
|
||||
} from "./components/CodeOutput";
|
||||
|
||||
import configureStore from "./store";
|
||||
import { initSourceFile, updateSourceFile } from "./store/sourceFiles/actions";
|
||||
|
||||
import styles from "./styles.css";
|
||||
|
||||
export type Props = { text: string };
|
||||
// import styles from "./styles.css";
|
||||
|
||||
const store = configureStore();
|
||||
|
||||
export class ExampleComponent extends React.Component<Props> {
|
||||
render() {
|
||||
const { text } = this.props;
|
||||
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<div className={styles.test}>Example Component: {text}</div>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
export function ASTVisualizer() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
Initial:
|
||||
<br />
|
||||
<CodeOutputForInitial />
|
||||
Current:
|
||||
<br />
|
||||
<CodeOutputForCurrent />
|
||||
<ASTOutline />
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export { initSourceFile, updateSourceFile };
|
||||
const {
|
||||
initSourceFile: initSourceFileConnected,
|
||||
updateSourceFile: updateSourceFileConnected
|
||||
} = bindActionCreators({ initSourceFile, updateSourceFile }, store.dispatch);
|
||||
|
||||
export {
|
||||
initSourceFileConnected as initSourceFile,
|
||||
updateSourceFileConnected as updateSourceFile
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user