ngrx / store-devtools

Developer Tools for @ngrx/store
MIT License
325 stars 38 forks source link

Property 'instrumentOnlyWithExtension' does not exist on type 'typeof StoreDevtoolsModule'. #71

Open daituzhang opened 7 years ago

daituzhang commented 7 years ago

Hi, I got this error when I try to import StoreDevtoolsModule.instrumentOnlyWithExtension()

I'm using: angular/core: "^4.0.0", "@ngrx/core": "^1.2.0", "@ngrx/store": "^2.2.3", "@ngrx/store-devtools": "^3.2.4", "typescript": "~2.3.3" Does anyone know why?

Thank you!!

JloMexmax commented 7 years ago

I found that you need to use only instrument StoreDevtoolsModule.instrument()

but I have these versions:

"@ngrx/core": "^1.2.0",
"@ngrx/store": "^4.0.2",
"@ngrx/store-devtools": "^4.0.0",
grizzm0 commented 7 years ago

What @JloMexmax posted will enable it in production aswell. What you can do as of v4 is put the following as an import. (assuming you have the environment.production variable) !environment.production ? StoreDevtoolsModule.instrument() : []

krismeister commented 7 years ago

@grizzm0 Thanks for the fix. I'm new to ngrx, and been experiencing a lot of difficulty finding correct information for v4, your example works well.

mfp22 commented 7 years ago

What if we want to still enable it in production if the extension exists?