Comparing version 0.2.6 to 0.2.7
@@ -43,2 +43,5 @@ /** | ||
Dispatcher.registerStore = function registerStore(store) { | ||
if ('function' !== typeof store) { | ||
throw new Error('registerStore requires a constructor as first parameter'); | ||
} | ||
var storeName = Dispatcher.getStoreName(store); | ||
@@ -49,3 +52,7 @@ if (!storeName) { | ||
if (Dispatcher.stores[storeName]) { | ||
throw new Error('Store `' + storeName + '` is already registered.'); | ||
if (Dispatcher.stores[storeName] === store) { | ||
// Store is already registered, nothing to do | ||
return; | ||
} | ||
throw new Error('Store with name `' + storeName + '` has already been registered.'); | ||
} | ||
@@ -52,0 +59,0 @@ Dispatcher.stores[storeName] = store; |
{ | ||
"name": "dispatchr", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"description": "A Flux dispatcher for applications that run on the server and the client.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
428
65145