@@ -52,27 +52,12 @@ function createDispatchers(
5252 } , { } ) ;
5353}
5454
55- /**
56- * createEventDispatchers
57- *
58- * Creates a set of dispatchers to dispatch game flow events.
59- * @param {Array } eventNames - A list of event names.
60- * @param {object } store - The Redux store to create dispatchers for.
61- * @param {string } playerID - The ID of the player dispatching these events.
62- * @param {string } credentials - A key indicating that the player is authorized to play.
63- */
64- export const createEventDispatchers = createDispatchers . bind ( null , 'gameEvent' ) ;
65-
66- /**
67- * createMoveDispatchers
68- *
69- * Creates a set of dispatchers to make moves.
70- * @param {Array } moveNames - A list of move names.
71- * @param {object } store - The Redux store to create dispatchers for.
72- * @param {string } playerID - The ID of the player dispatching these events.
73- * @param {string } credentials - A key indicating that the player is authorized to play.
74- */
55+ // Creates a set of dispatchers to make moves.
7556export const createMoveDispatchers = createDispatchers . bind ( null , 'makeMove' ) ;
57+ // Creates a set of dispatchers to dispatch game flow events.
58+ export const createEventDispatchers = createDispatchers . bind ( null , 'gameEvent' ) ;
59+ // Creates a set of dispatchers to dispatch actions to plugins.
60+ export const createPluginDispatchers = createDispatchers . bind ( null , 'plugin' ) ;
7661
7762/**
7863 * Implementation of Client (see below).
@@ -395,6 +380,14 @@ class _ClientImpl {
395380 this . credentials ,
396381 this . multiplayer
397382 ) ;
383+
384+ this . plugins = createPluginDispatchers (
385+ this . game . pluginNames ,
386+ this . store ,
387+ this . playerID ,
388+ this . credentials ,
389+ this . multiplayer
390+ ) ;
398391 }
399392
400393 updatePlayerID ( playerID ) {
0 commit comments