Skip to content

Commit 2372afd

Browse files
committed
Config, example & docs
1 parent 11fbe25 commit 2372afd

File tree

7 files changed

+443
-2
lines changed

7 files changed

+443
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ build/Release
2525

2626
# Dependency directory
2727
node_modules
28+
jspm_packages
2829

2930
# Optional npm cache directory
3031
.npm

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
# systemjs-hot-reloader-store
2-
Utility for storing data across hot reloads
1+
# SystemJS hot reloader store
2+
Extremely simple utility for storing data across hot reloads.
3+
Compatible with: [systemjs-hot-reloader](https://github.com/capaj/systemjs-hot-reloader)
4+
5+
## Usage
6+
``` javascript
7+
import getHotReloadStore from './utils/getHotReloadStore.js';
8+
const hotStore = getHotReloadStore('project:index'); // pick unique name
9+
10+
// retrieve stored or create new state
11+
const state = hotStore.state || {
12+
counter: 0
13+
};
14+
15+
// change state
16+
state.counter += 1;
17+
18+
// store state
19+
hotStore.state = state;
20+
```

config.js

Lines changed: 344 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
System.config({
2+
baseURL: "/",
3+
defaultJSExtensions: true,
4+
transpiler: "babel",
5+
babelOptions: {
6+
"optional": [
7+
"runtime",
8+
"optimisation.modules.system"
9+
]
10+
},
11+
paths: {
12+
"github:*": "jspm_packages/github/*",
13+
"npm:*": "jspm_packages/npm/*"
14+
},
15+
16+
map: {
17+
"babel": "npm:[email protected]",
18+
"babel-runtime": "npm:[email protected]",
19+
"core-js": "npm:[email protected]",
20+
"systemjs-hot-reloader": "github:capaj/[email protected]",
21+
"github:capaj/[email protected]": {
22+
"debug": "npm:[email protected]",
23+
"socket.io-client": "github:socketio/[email protected]",
24+
"weakee": "npm:[email protected]"
25+
},
26+
"github:jspm/[email protected]": {
27+
"assert": "npm:[email protected]"
28+
},
29+
"github:jspm/[email protected]": {
30+
"buffer": "npm:[email protected]"
31+
},
32+
"github:jspm/[email protected]": {
33+
"constants-browserify": "npm:[email protected]"
34+
},
35+
"github:jspm/[email protected]": {
36+
"crypto-browserify": "npm:[email protected]"
37+
},
38+
"github:jspm/[email protected]": {
39+
"events": "npm:[email protected]"
40+
},
41+
"github:jspm/[email protected]": {
42+
"Base64": "npm:[email protected]",
43+
"events": "github:jspm/[email protected]",
44+
"inherits": "npm:[email protected]",
45+
"stream": "github:jspm/[email protected]",
46+
"url": "github:jspm/[email protected]",
47+
"util": "github:jspm/[email protected]"
48+
},
49+
"github:jspm/[email protected]": {
50+
"buffer": "github:jspm/[email protected]",
51+
"crypto": "github:jspm/[email protected]",
52+
"http": "github:jspm/[email protected]",
53+
"net": "github:jspm/[email protected]",
54+
"process": "github:jspm/[email protected]",
55+
"stream": "github:jspm/[email protected]",
56+
"timers": "github:jspm/[email protected]",
57+
"util": "github:jspm/[email protected]"
58+
},
59+
"github:jspm/[email protected]": {
60+
"path-browserify": "npm:[email protected]"
61+
},
62+
"github:jspm/[email protected]": {
63+
"process": "npm:[email protected]"
64+
},
65+
"github:jspm/[email protected]": {
66+
"stream-browserify": "npm:[email protected]"
67+
},
68+
"github:jspm/[email protected]": {
69+
"string_decoder": "npm:[email protected]"
70+
},
71+
"github:jspm/[email protected]": {
72+
"timers-browserify": "npm:[email protected]"
73+
},
74+
"github:jspm/[email protected]": {
75+
"tty-browserify": "npm:[email protected]"
76+
},
77+
"github:jspm/[email protected]": {
78+
"url": "npm:[email protected]"
79+
},
80+
"github:jspm/[email protected]": {
81+
"util": "npm:[email protected]"
82+
},
83+
"github:jspm/[email protected]": {
84+
"vm-browserify": "npm:[email protected]"
85+
},
86+
87+
"assert": "github:jspm/[email protected]",
88+
"bn.js": "npm:[email protected]",
89+
"buffer": "github:jspm/[email protected]",
90+
"fs": "github:jspm/[email protected]",
91+
"inherits": "npm:[email protected]",
92+
"minimalistic-assert": "npm:[email protected]",
93+
"vm": "github:jspm/[email protected]"
94+
},
95+
96+
"util": "npm:[email protected]"
97+
},
98+
99+
"process": "github:jspm/[email protected]"
100+
},
101+
102+
"buffer": "github:jspm/[email protected]"
103+
},
104+
105+
"buffer": "github:jspm/[email protected]",
106+
"buffer-xor": "npm:[email protected]",
107+
"cipher-base": "npm:[email protected]",
108+
"create-hash": "npm:[email protected]",
109+
"crypto": "github:jspm/[email protected]",
110+
"evp_bytestokey": "npm:[email protected]",
111+
"fs": "github:jspm/[email protected]",
112+
"inherits": "npm:[email protected]",
113+
"systemjs-json": "github:systemjs/[email protected]"
114+
},
115+
116+
"browserify-aes": "npm:[email protected]",
117+
"browserify-des": "npm:[email protected]",
118+
"buffer": "github:jspm/[email protected]",
119+
"crypto": "github:jspm/[email protected]",
120+
"evp_bytestokey": "npm:[email protected]"
121+
},
122+
123+
"buffer": "github:jspm/[email protected]",
124+
"cipher-base": "npm:[email protected]",
125+
"crypto": "github:jspm/[email protected]",
126+
"des.js": "npm:[email protected]",
127+
"inherits": "npm:[email protected]"
128+
},
129+
130+
"bn.js": "npm:[email protected]",
131+
"buffer": "github:jspm/[email protected]",
132+
"constants": "github:jspm/[email protected]",
133+
"crypto": "github:jspm/[email protected]",
134+
"randombytes": "npm:[email protected]"
135+
},
136+
137+
"bn.js": "npm:[email protected]",
138+
"browserify-rsa": "npm:[email protected]",
139+
"buffer": "github:jspm/[email protected]",
140+
"create-hash": "npm:[email protected]",
141+
"create-hmac": "npm:[email protected]",
142+
"crypto": "github:jspm/[email protected]",
143+
"elliptic": "npm:[email protected]",
144+
"inherits": "npm:[email protected]",
145+
"parse-asn1": "npm:[email protected]",
146+
"stream": "github:jspm/[email protected]"
147+
},
148+
149+
"buffer": "github:jspm/[email protected]",
150+
"systemjs-json": "github:systemjs/[email protected]"
151+
},
152+
153+
"base64-js": "npm:[email protected]",
154+
"child_process": "github:jspm/[email protected]",
155+
"fs": "github:jspm/[email protected]",
156+
"ieee754": "npm:[email protected]",
157+
"isarray": "npm:[email protected]",
158+
"process": "github:jspm/[email protected]"
159+
},
160+
161+
"buffer": "github:jspm/[email protected]",
162+
"inherits": "npm:[email protected]",
163+
"stream": "github:jspm/[email protected]",
164+
"string_decoder": "github:jspm/[email protected]"
165+
},
166+
167+
"systemjs-json": "github:systemjs/[email protected]"
168+
},
169+
170+
"fs": "github:jspm/[email protected]",
171+
"path": "github:jspm/[email protected]",
172+
"process": "github:jspm/[email protected]",
173+
"systemjs-json": "github:systemjs/[email protected]"
174+
},
175+
176+
"buffer": "github:jspm/[email protected]"
177+
},
178+
179+
"bn.js": "npm:[email protected]",
180+
"buffer": "github:jspm/[email protected]",
181+
"crypto": "github:jspm/[email protected]",
182+
"elliptic": "npm:[email protected]"
183+
},
184+
185+
"buffer": "github:jspm/[email protected]",
186+
"cipher-base": "npm:[email protected]",
187+
"crypto": "github:jspm/[email protected]",
188+
"fs": "github:jspm/[email protected]",
189+
"inherits": "npm:[email protected]",
190+
"ripemd160": "npm:[email protected]",
191+
"sha.js": "npm:[email protected]"
192+
},
193+
194+
"buffer": "github:jspm/[email protected]",
195+
"create-hash": "npm:[email protected]",
196+
"crypto": "github:jspm/[email protected]",
197+
"inherits": "npm:[email protected]",
198+
"stream": "github:jspm/[email protected]"
199+
},
200+
201+
"browserify-cipher": "npm:[email protected]",
202+
"browserify-sign": "npm:[email protected]",
203+
"create-ecdh": "npm:[email protected]",
204+
"create-hash": "npm:[email protected]",
205+
"create-hmac": "npm:[email protected]",
206+
"diffie-hellman": "npm:[email protected]",
207+
"inherits": "npm:[email protected]",
208+
"pbkdf2": "npm:[email protected]",
209+
"public-encrypt": "npm:[email protected]",
210+
"randombytes": "npm:[email protected]"
211+
},
212+
213+
"fs": "github:jspm/[email protected]",
214+
"ms": "npm:[email protected]",
215+
"net": "github:jspm/[email protected]",
216+
"process": "github:jspm/[email protected]",
217+
"tty": "github:jspm/[email protected]",
218+
"util": "github:jspm/[email protected]"
219+
},
220+
221+
"buffer": "github:jspm/[email protected]",
222+
"inherits": "npm:[email protected]",
223+
"minimalistic-assert": "npm:[email protected]"
224+
},
225+
226+
"bn.js": "npm:[email protected]",
227+
"buffer": "github:jspm/[email protected]",
228+
"crypto": "github:jspm/[email protected]",
229+
"miller-rabin": "npm:[email protected]",
230+
"randombytes": "npm:[email protected]",
231+
"systemjs-json": "github:systemjs/[email protected]"
232+
},
233+
234+
"bn.js": "npm:[email protected]",
235+
"brorand": "npm:[email protected]",
236+
"hash.js": "npm:[email protected]",
237+
"inherits": "npm:[email protected]",
238+
"systemjs-json": "github:systemjs/[email protected]"
239+
},
240+
241+
"buffer": "github:jspm/[email protected]",
242+
"create-hash": "npm:[email protected]",
243+
"crypto": "github:jspm/[email protected]"
244+
},
245+
246+
"inherits": "npm:[email protected]"
247+
},
248+
249+
"util": "github:jspm/[email protected]"
250+
},
251+
252+
"systemjs-json": "github:systemjs/[email protected]"
253+
},
254+
255+
"bn.js": "npm:[email protected]",
256+
"brorand": "npm:[email protected]"
257+
},
258+
259+
"asn1.js": "npm:[email protected]",
260+
"browserify-aes": "npm:[email protected]",
261+
"buffer": "github:jspm/[email protected]",
262+
"create-hash": "npm:[email protected]",
263+
"evp_bytestokey": "npm:[email protected]",
264+
"pbkdf2": "npm:[email protected]",
265+
"systemjs-json": "github:systemjs/[email protected]"
266+
},
267+
268+
"process": "github:jspm/[email protected]"
269+
},
270+
271+
"buffer": "github:jspm/[email protected]",
272+
"child_process": "github:jspm/[email protected]",
273+
"create-hmac": "npm:[email protected]",
274+
"crypto": "github:jspm/[email protected]",
275+
"path": "github:jspm/[email protected]",
276+
"process": "github:jspm/[email protected]",
277+
"systemjs-json": "github:systemjs/[email protected]"
278+
},
279+
280+
"assert": "github:jspm/[email protected]"
281+
},
282+
283+
"bn.js": "npm:[email protected]",
284+
"browserify-rsa": "npm:[email protected]",
285+
"buffer": "github:jspm/[email protected]",
286+
"create-hash": "npm:[email protected]",
287+
"crypto": "github:jspm/[email protected]",
288+
"parse-asn1": "npm:[email protected]",
289+
"randombytes": "npm:[email protected]"
290+
},
291+
292+
"process": "github:jspm/[email protected]"
293+
},
294+
295+
"buffer": "github:jspm/[email protected]",
296+
"crypto": "github:jspm/[email protected]",
297+
"process": "github:jspm/[email protected]"
298+
},
299+
300+
"buffer": "github:jspm/[email protected]",
301+
"core-util-is": "npm:[email protected]",
302+
"events": "github:jspm/[email protected]",
303+
"inherits": "npm:[email protected]",
304+
"isarray": "npm:[email protected]",
305+
"process": "github:jspm/[email protected]",
306+
"stream-browserify": "npm:[email protected]",
307+
"string_decoder": "npm:[email protected]"
308+
},
309+
310+
"buffer": "github:jspm/[email protected]",
311+
"process": "github:jspm/[email protected]"
312+
},
313+
314+
"buffer": "github:jspm/[email protected]",
315+
"fs": "github:jspm/[email protected]",
316+
"inherits": "npm:[email protected]",
317+
"process": "github:jspm/[email protected]"
318+
},
319+
320+
"events": "github:jspm/[email protected]",
321+
"inherits": "npm:[email protected]",
322+
"readable-stream": "npm:[email protected]"
323+
},
324+
325+
"buffer": "github:jspm/[email protected]"
326+
},
327+
328+
"process": "npm:[email protected]"
329+
},
330+
331+
"assert": "github:jspm/[email protected]",
332+
"punycode": "npm:[email protected]",
333+
"querystring": "npm:[email protected]",
334+
"util": "github:jspm/[email protected]"
335+
},
336+
337+
"inherits": "npm:[email protected]",
338+
"process": "github:jspm/[email protected]"
339+
},
340+
341+
"indexof": "npm:[email protected]"
342+
}
343+
}
344+
});

example/app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import 'systemjs-hot-reloader/default-listener.js';
2+
import getHotReloadStore from '../index.js';
3+
const hotStore = getHotReloadStore('example:index'); // unique name
4+
5+
// retrieve stored or create new state
6+
const state = hotStore.state || {
7+
counter: 0
8+
};
9+
10+
// change state
11+
state.counter += 1;
12+
console.log('state.counter: ', state.counter);
13+
14+
// store state
15+
hotStore.state = state;

0 commit comments

Comments
 (0)