Skip to content

Instantly share code, notes, and snippets.

@arturovt
Last active March 14, 2019 10:45
Show Gist options
  • Save arturovt/05c532f9569598749626bbf366bbd2d1 to your computer and use it in GitHub Desktop.
Save arturovt/05c532f9569598749626bbf366bbd2d1 to your computer and use it in GitHub Desktop.
function ensureStoreMetadata(target) {
if (!target.hasOwnProperty(META_KEY)) {
const defaultMetadata = {
name: null,
actions: {},
defaults: {},
path: null,
selectFromAppState: null,
children: [],
instance: null
};
Object.defineProperty(target, META_KEY, { value: defaultMetadata });
}
return getStoreMetadata(target);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment