Skip to content
Snippets Groups Projects
Commit d8f3cc56 authored by Greg Fodor's avatar Greg Fodor
Browse files

Different key, do not worry about id

parent 60afd6c5
No related branches found
No related tags found
No related merge requests found
import { Validator } from "jsonschema";
import { merge } from "lodash";
const LOCAL_STORE_KEY = "___mozilla_hubs";
const LOCAL_STORE_KEY = "___hubs_store";
const STORE_STATE_CACHE_KEY = Symbol();
const validator = new Validator();
import { EventTarget } from "event-target-shim";
......@@ -9,7 +9,7 @@ import { EventTarget } from "event-target-shim";
// Durable (via local-storage) schema-enforced state that is meant to be consumed via forward data flow.
// (Think flux but with way less incidental complexity, at least for now :))
export const SCHEMA = {
id: "/MozillaHubsStore",
id: "/HubsStore",
definitions: {
profile: {
......@@ -68,10 +68,6 @@ export default class Store extends EventTarget {
}
update(newState) {
if (newState.id) {
throw new Error("Store id is immutable.");
}
const finalState = merge(this.state, newState);
const isValid = validator.validate(finalState, SCHEMA).valid;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment