Comparing version 0.12.3 to 0.13.0
@@ -17,3 +17,2 @@ "use strict"; | ||
var ACTION_UID = Symbol("the actions uid name"); | ||
var BOOTSTRAP_FLAG = VariableSymbol("has bootstrap"); | ||
var EE = Symbol("event emitter instance"); | ||
@@ -115,3 +114,2 @@ var INIT_SNAPSHOT = Symbol("init snapshot storage"); | ||
this[ACTION_HANDLER] = action.bind(this); | ||
this[BOOTSTRAP_FLAG] = false; | ||
this.actions = actions; | ||
@@ -389,9 +387,2 @@ this.alt = alt; | ||
}); | ||
if (typeof window !== "undefined") { | ||
if (this[BOOTSTRAP_FLAG]) { | ||
throw new ReferenceError("Stores have already been bootstrapped"); | ||
} | ||
this[BOOTSTRAP_FLAG] = true; | ||
} | ||
}, | ||
@@ -398,0 +389,0 @@ writable: true, |
@@ -21,3 +21,2 @@ "use strict"; | ||
var ACTION_UID = Symbol("the actions uid name"); | ||
var BOOTSTRAP_FLAG = VariableSymbol("has bootstrap"); | ||
var EE = Symbol("event emitter instance"); | ||
@@ -119,3 +118,2 @@ var INIT_SNAPSHOT = Symbol("init snapshot storage"); | ||
this[ACTION_HANDLER] = action.bind(this); | ||
this[BOOTSTRAP_FLAG] = false; | ||
this.actions = actions; | ||
@@ -393,9 +391,2 @@ this.alt = alt; | ||
}); | ||
if (typeof window !== "undefined") { | ||
if (this[BOOTSTRAP_FLAG]) { | ||
throw new ReferenceError("Stores have already been bootstrapped"); | ||
} | ||
this[BOOTSTRAP_FLAG] = true; | ||
} | ||
}, | ||
@@ -402,0 +393,0 @@ writable: true, |
{ | ||
"name": "alt", | ||
"version": "0.12.3", | ||
"version": "0.13.0", | ||
"description": "A flux implementation", | ||
@@ -5,0 +5,0 @@ "main": "dist/alt.js", |
@@ -455,17 +455,8 @@ "use strict"; | ||
alt.bootstrap("{\"MyStore\":{\"name\":\"bee\"}}"); | ||
assert.equal(myStore.getState().name, "bee", "on server I can bootstrap many times"); | ||
assert.equal(myStore.getState().name, "bee", "I can bootstrap many times"); | ||
try { | ||
// simulate the browser | ||
global.window = {}; | ||
alt.bootstrap("{}"); | ||
alt.bootstrap("{}"); | ||
// Attempting to bootstrap more than once | ||
alt.bootstrap("{\"MyStore\":{\"name\":\"bee\"}}"); | ||
assert.equal(true, false, "I was able bootstrap more than once which is bad"); | ||
} catch (e) { | ||
assert.equal(e instanceof ReferenceError, true, "can only bootstrap once"); | ||
assert.equal(e.message, "Stores have already been bootstrapped", "can only bootstrap once"); | ||
} | ||
alt.bootstrap("{\"MyStore\":{\"name\":\"monkey\"}}"); | ||
assert.equal(myStore.getState().name, "monkey", "I can bootstrap many times"); | ||
}, | ||
@@ -472,0 +463,0 @@ |
@@ -367,17 +367,8 @@ require('6to5/runtime') | ||
alt.bootstrap('{"MyStore":{"name":"bee"}}') | ||
assert.equal(myStore.getState().name, 'bee', 'on server I can bootstrap many times') | ||
assert.equal(myStore.getState().name, 'bee', 'I can bootstrap many times') | ||
try { | ||
// simulate the browser | ||
global.window = {}; | ||
alt.bootstrap('{}') | ||
alt.bootstrap('{}') | ||
// Attempting to bootstrap more than once | ||
alt.bootstrap('{"MyStore":{"name":"bee"}}') | ||
assert.equal(true, false, 'I was able bootstrap more than once which is bad') | ||
} catch (e) { | ||
assert.equal(e instanceof ReferenceError, true, 'can only bootstrap once') | ||
assert.equal(e.message, 'Stores have already been bootstrapped', 'can only bootstrap once') | ||
} | ||
alt.bootstrap('{"MyStore":{"name":"monkey"}}') | ||
assert.equal(myStore.getState().name, 'monkey', 'I can bootstrap many times') | ||
}, | ||
@@ -384,0 +375,0 @@ |
Sorry, the diff of this file is not supported yet
104267
1990