File tree 4 files changed +35
-7
lines changed
4 files changed +35
-7
lines changed Original file line number Diff line number Diff line change 1
- # 0.3.4
1
+ # 0.3.4-0.3.5
2
2
3
- * Adds ` server ` options ` connectRedux ` and ` getStatistics `
3
+ * Adds ` server ` options ` connectRedux ` , ` getStatistics ` , ` primusOptions ` and
4
+ ` dispatcherOptions `
4
5
5
6
# 0.3.3
6
7
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " redux-scuttlebutt" ,
3
- "version" : " 0.3.4 " ,
3
+ "version" : " 0.3.5 " ,
4
4
"description" : " Redux distributed dispatcher" ,
5
5
"main" : " lib/index.js" ,
6
6
"engines" : {
Original file line number Diff line number Diff line change
1
+
2
+ ``` js
3
+ var scuttlebutt = require (' redux-scuttlebutt/lib/server' ).default
4
+ var serverOptions = {}
5
+
6
+ scuttlebutt (server, serverOptions)
7
+ ```
8
+
9
+ # server options
10
+
11
+ ### ` dispatcherOptions ` and ` primusOptions `
12
+
13
+ ## ` connectRedux(gossip) `
14
+
15
+ gossip is a store enhancer, connect it to redux
16
+
17
+ ## ` getStatistics() `
18
+
19
+ return value will be called with (source, event), so you can render statistics
20
+
21
+ ## env vars
22
+
23
+ ### ` INFILE ` , ` OUTFILE `
24
+
25
+ ### ` SB_REMOTE `
Original file line number Diff line number Diff line change @@ -7,18 +7,20 @@ const INFILE = process.env['INFILE'],
7
7
const defaultOptions = {
8
8
connectRedux,
9
9
getStatistics,
10
+ primusOptions : { } ,
11
+ dispatcherOptions : { } ,
10
12
}
11
13
12
14
export default function scuttlebuttServer ( server , options ) {
13
15
options = { ...defaultOptions , ...options }
14
16
15
- const primusServer = new ( require ( 'primus' ) ) ( server , { } ) ,
17
+ const primusServer = new ( require ( 'primus' ) ) ( server , options . primusOptions ) ,
16
18
Dispatcher = require ( './dispatcher' ) . default ,
17
- gossip = new Dispatcher ( ) ,
18
- onStatistic = getStatistics ( )
19
+ gossip = new Dispatcher ( options . dispatcherOptions ) ,
20
+ onStatistic = options . getStatistics ( )
19
21
20
22
// connect dispatcher to redux
21
- connectRedux ( gossip )
23
+ options . connectRedux ( gossip )
22
24
23
25
// read actions from file
24
26
if ( INFILE ) {
You can’t perform that action at this time.
0 commit comments