yahoo / fluxible

A pluggable container for universal flux applications.
http://fluxible.io
Other
1.81k stars 226 forks source link

Allow access to Services from within a Component #188

Closed charles-tai closed 9 years ago

charles-tai commented 9 years ago

I want to verify if a user inputted email is available in the db, I just need a boolean response from the server.

I could just make an ajax call from within the Component using superagent (or another ajax library), but I was wondering if theres a way to access Services from within a component? That way, I can just use a Service to access my db instead of using an external library.

I understand that Fluxible wants to enforce unidirectional flow and only allows access to Services from within an Action Context. But in this case, i'm not dealing with persistent data. So i have no need to go through Stores, I just need a boolean response from my server.

mridgway commented 9 years ago

We will probably not expose this by default in fluxible-plugin-fetchr. If you need this functionality, you could achieve this using a Fluxible plugin or as you said just use a third-party library like superagent.

charles-tai commented 9 years ago

Thanks mridgway, Ill try to create a Fluxible plugin to expose Services in the Component context.

From your experience, do you see any potential red flags from this approach?