From 690732d8688478b47adfc42d9436f4a1303b5ba4 Mon Sep 17 00:00:00 2001 From: Boopathi Rajaa Date: Thu, 4 Jun 2015 03:34:26 +0530 Subject: [PATCH] Allow symbols to be actionTypes. So you can have export const MY_ACTION = Symbol() --- src/createDispatcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/createDispatcher.js b/src/createDispatcher.js index 6c742fead7..da80ba2f29 100644 --- a/src/createDispatcher.js +++ b/src/createDispatcher.js @@ -63,8 +63,8 @@ export default function createDispatcher() { // Reassign the current state on each dispatch function dispatch(action) { invariant( - typeof action.type === 'string', - 'Action type must be a string.' + typeof action.type === 'string' || typeof action.type === 'symbol', + 'Action type must be a string or a Symbol.' ); const nextState = computeNextState(currentState, action);