fix: move store check to generation

Per @Conduitry's request
pull/1829/head
Pat Cavit 8 years ago
parent c27b86aaec
commit b2af6da1bd

@ -152,8 +152,8 @@ export default function dom(
if (!options || (!options.target && !options.root)) { if (!options || (!options.target && !options.root)) {
throw new Error("'target' is a required option"); throw new Error("'target' is a required option");
}`} }`}
${storeProps.length > 0 && deindent` ${storeProps.length > 0 && !templateProperties.store && deindent`
if (!options.store && !${templateProperties.store}) { if (!options.store) {
throw new Error("${debugName} references store properties, but no store was provided"); throw new Error("${debugName} references store properties, but no store was provided");
}`} }`}
`} `}

@ -115,8 +115,8 @@ export default function ssr(
${templateProperties.store && `options.store = %store();`} ${templateProperties.store && `options.store = %store();`}
__result.addComponent(${name}); __result.addComponent(${name});
${options.dev && storeProps.length > 0 && deindent` ${options.dev && storeProps.length > 0 && !templateProperties.store && deindent`
if (!options.store && !${templateProperties.store}) { if (!options.store) {
throw new Error("${debugName} references store properties, but no store was provided"); throw new Error("${debugName} references store properties, but no store was provided");
} }
`} `}

Loading…
Cancel
Save