christianalfoni / flux-angular

Use the FLUX architecture with Angular JS
313 stars 50 forks source link

Request: actions helper #9

Closed unoriginalscreenname closed 9 years ago

unoriginalscreenname commented 9 years ago

First off, I'm really enjoying working with your library. You've put this together really well.

I wanted to throw an idea at you that i saw in another flux library called "reflux" (https://github.com/spoike/refluxjs). He's got a couple really nice helpers when creating the stores. I like how he has a "listenToMany" or just a "listenables: actions" in there that automatically binds actions to functions. It makes the library a little easier to use, and i'm finding that without it it feels like i'm really having to wire up a lot of functions with the same name.

Just a thought from someone who's used a few of these flux frameworks... i understand reflux may have a different opinion on this stuff than your library.

christianalfoni commented 9 years ago

Hi @ericmcgregor and thank you so much for the feedback and the suggestion :-)

Your suggestion definitely makes sense and should not be much work implementing. I am actually working on flux-angular 2.0, which uses the Yahoo Dispatchr and makes it feel like flux was actually a part of Angular from the start. I will still develop 1.x though.

But maybe I could show you 2.0 first and then we will see how you feel about it? You might like the new version even more ;-)

I hope to get it out today, or at least by the end of this week.

unoriginalscreenname commented 9 years ago

Sure, i'd love to take a look. I have a little local experiment project that i've been using to try out different methodologies inside angular. It's one UI component with a few basic features, but it's a good example to try and build using different approaches.

I loved the idea of flux, but found react to be too much for me on it's own. I think a flux architecture inside angular is a really great fit and solves a lot of angular problems.

I'd be really interested to learn more about the yahoo dispatchr and how you're looking to make angular more flux-infused.

christianalfoni commented 9 years ago

Okay @ericmcgregor, it is released, let me know what you think :-)

sheerun commented 9 years ago

Don't forget to create git tag for bower

On Wed, Jan 7, 2015 at 7:23 PM, Christian Alfoni notifications@github.com wrote:

Okay @ericmcgregor https://github.com/ericmcgregor, it is released, let me know what you think :-)

— Reply to this email directly or view it on GitHub https://github.com/christianalfoni/flux-angular/issues/9#issuecomment-69066353 .

unoriginalscreenname commented 9 years ago

wow, looks like some really interesting changes. (and right as i was getting some good progress is 1.x!) :)

good stuff, @christianalfoni. I'll switch over and give this a go sometime this week. thanks!

anything you're particularly excited about in 2.0? what do you think sets this one apart from some of the others out there?

christianalfoni commented 9 years ago

@sheerun hehe, I remembered it this time :-)

christianalfoni commented 9 years ago

Hi @ericmcgregor, thank you very much for taking the time to check it out :-)

I think Yahoo has done a good job keeping the original Flux dispatcher/store concept from Facebook, but with a lot better syntax. It is also a syntax that fits nicely with Angular. Pointing to this.waitFor("SomeStore", function () {}). It uses a string as reference, which Angular does a lot already. But Angular is different in regards of rendering so allowing for the wildcard events of EventEmitter2 I think will make it easier to control performance.

I do not think there are a lot of Flux Angular concepts out there really. If so I do not think it fits so nicely into the Angular "habitat". This lib feels like it belongs in Angular :-)

So yeah, that was some thoughts on that. Thanks again for trying it out!

unoriginalscreenname commented 9 years ago

hey, i'm having some trouble pulling it down from bower. i'm not sure you have a 2.0 tag. or maybe you haven't merged the branch yet? and i can't seem to get the 'version 2' branch to pull down. :( I might not be doing something right though.

christianalfoni commented 9 years ago

Try again, forgot the tags parameter when pushing :p

christianalfoni commented 9 years ago

You still got the error @ericmcgregor ?

unoriginalscreenname commented 9 years ago

great! the tag works now, pulled 2.0 from bower. the error was because i was using a local bower override to get the 2.0 file from the build directory for the gulp bower-files module and i had an extra comma. all good now!

christianalfoni commented 9 years ago

So @sheerun , thanks for the reminder... ;-)

Great to hear eric!

unoriginalscreenname commented 9 years ago

curious... looking at this a little deeper... did you get rid of the idea of mixins?

christianalfoni commented 9 years ago

You can still still share state between stores using a factory, which was the main purpose of mixins. Example in readme :-) l think that should suffice. Let me know if you have any bad experiences though.

On Thursday, January 8, 2015, Eric McGregor notifications@github.com wrote:

curious... looking at this a little deeper... did you get rid of the idea of mixins?

— Reply to this email directly or view it on GitHub https://github.com/christianalfoni/flux-angular/issues/9#issuecomment-69196042 .