Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (isGlobal && feature !== DEFAULT_FEATURE) {
warn(
`You are using a feature (${feature}) with global ${type}.`,
'This will have no effect.'
);
}
if (!namespace && !isGlobal) {
warn(
`You're injecting ${type} with no namespace!`,
'They will be injected globally. If this is intended, consider passing',
`'isGlobal: true' to the injector, e.g. '${hookName}(${type}, { isGlobal: true })'.`
);
}
if (isNotNil(options.global)) {
warn(`'global: ${options.global}' is deprecated. Use 'isGlobal: ${options.global}'.`);
}
if (isNotNil(options.persist)) {
warn(
`'persist: ${options.persist}' is deprecated. Use 'isPersistent: ${options.persist}'.`
);
}
invariant(inject, `'store.${injectionKey}' missing. Are you using the enhancer correctly?`);
invariant(eject, `'store.${ejectionKey}' missing. Are you using the enhancer correctly?`);
inject(injectables, props);
setIsInitialized(true);
return () => {
);
}
if (!namespace && !isGlobal) {
warn(
`You're injecting ${type} with no namespace!`,
'They will be injected globally. If this is intended, consider passing',
`'isGlobal: true' to the injector, e.g. '${hookName}(${type}, { isGlobal: true })'.`
);
}
if (isNotNil(options.global)) {
warn(`'global: ${options.global}' is deprecated. Use 'isGlobal: ${options.global}'.`);
}
if (isNotNil(options.persist)) {
warn(
`'persist: ${options.persist}' is deprecated. Use 'isPersistent: ${options.persist}'.`
);
}
invariant(inject, `'store.${injectionKey}' missing. Are you using the enhancer correctly?`);
invariant(eject, `'store.${ejectionKey}' missing. Are you using the enhancer correctly?`);
inject(injectables, props);
setIsInitialized(true);
return () => {
if (!isPersistent) {
eject(injectables, props);
}
};