Closed zalmoxisus closed 8 years ago
Hi @zalmoxisus, thanks for the bug report.
There are a couple of things going on here:
require()
it if it exists, but will work perfectly fine without it. The reason for this is that we want to be able to allow people to use @select
and have it work regardless if whether their store contains Immutable types or plain JS objects.However when we're included via webpack, it's not understanding the conditional require on our end and outputs a warning. We'll look to suppress this going forwards.
options
parameter is optional. I have fixed this in #164. The workaround for now is to pass an empty object in this case: [ ...enhancers, devTool.enhancer({}) ]
.Also I just noticed that the original issue you quoted is for angular 1 - this is the angular 2 connector :)
If you're still having issues with the angular 1 connector, I'll get in touch with my colleagues who work on https://github.com/angular-redux/ng-redux and we'll try to help you out.
PS huge fan of the chrome extension - it's saved me a lot of headaches!
Keeping the issue open pending resolution of the webpack warning. However you should be able to run the example app with npm run dev
now.
@clbond @e-schultz Turns out webpack's not a huge fan of the conditional require in utils/get-in.ts
. It doesn't break anything, but we do get a scary-looking warning in the console and a large stack trace in the browser console.
We should see if there's a way to work around this. If we have to depend in immutable directly, we'll need to check two things:
An easy way to check the systemJS thing is load up the examples from the redux section of ngcourse2, update the ng2-redux dep, and see what happens...
@SethDavenport, thanks for the details and the feedback! It's a good example not only for using redux with angular, but also for integrating it with typescript.
Regarding conditional dependencies, I think easier is to just use it explicitly, so if I want to use the library with immutableJS, I would require ng2-redux/immutable
instead of ng2-redux
. Less magic, but it will also avoid including unnecessary libraries in the final bundle, just because I forgot to remove it form node_modules
.
Hmm. I will take a look at this today. Thank you
Thanks Chris.
I wonder if there's a way to do things that doesn't know about Immutable explicitly. E.g. look for a function called getIn on the selected object and call it if it exists.
Or for regular props try something foo.bar || foo.get('bar')
Trying to figure out an issue, wanted to run the counter example. First it requires
immutable
library. Then after installing it, there's an error in./containers/App.ts
(38,33):Supplied parameters do not match any signature of call target.
I'm not too familiar with typescript, and apologize if I'm missing something here.