-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04f676b
commit 4140ae4
Showing
3 changed files
with
39 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
NuclearJS Hot Reloading | ||
=== | ||
|
||
NuclearJS supports hot reloading of stores. Using the webpack Hot Module Replacement simply code like this to wherever your stores are registered. | ||
|
||
|
||
```js | ||
import { Reactor } from 'nuclear-js' | ||
import * as stores from './stores' | ||
|
||
const reactor = new Reactor({ | ||
debug: true, | ||
}) | ||
reactor.registerStores(stores) | ||
|
||
if (module.hot) { | ||
// Enable webpack hot module replacement for stores | ||
module.hot.accept('./stores', () => { | ||
reactor.replaceStores(require('./stores')) | ||
}) | ||
} | ||
|
||
export default reactor | ||
``` | ||
|
||
## Running Example | ||
|
||
``` | ||
npm install | ||
npm start | ||
``` | ||
|
||
Go to [http://localhost:3000](http://localhost:3000) | ||
|
||
## Inpsiration & Thanks | ||
|
||
Big thanks to [redux](https://github.com/rackt/redux) and [react-redux](https://github.com/rackt/react-redux) for proving out this architecture | ||
and creating simple APIs to accomplish hot reloading. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters