0.2.4 • Published 8 years ago
flax-devtools v0.2.4
Flax Dev Tools
Series of development tools to be used with Flax
Installation
Install flax-devtools through npm:
npm install --save flax-devtools
Add a FlaxWatcher component (in development mode) and pass it the FlaxDispatcher instance (that comes with flax) and an onReset function.
import App from './components/App.jsx';
import {FlaxDispatcher} from 'flax';
import {FlaxWatcher} from 'flax-devtools';
function resetApp() {
ReactDOM.unmountComponentAtNode(document.getElementById('todoapp'));
ReactDOM.render(<TodoApp />, document.getElementById('todoapp'));
}
if (process.env.NODE_ENV !== 'production') {
ReactDOM.render(<FlaxWatcher FlaxDispatcher={FlaxDispatcher} onReset={resetApp}/>,
document.body.appendChild(document.createElement('div')));
}
resetApp();
The onReset function is expected to be a function that puts your app in its initial rendering state.
How to Use
After the setup, the flax watcher component will be available to you as a sidebar.
Functionality
...