Famous / famous-angular

Bring structure to your Famo.us apps with the power of AngularJS. Famo.us/Angular integrates seamlessly with existing Angular and Famo.us apps.

Home Page:https://famo.us/angular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EventMapper not working

jfizz opened this issue · comments

I am attempting to use the famous EventMapper (http://www.famo.us/docs/events/EventMapper) to filter an event from one surface to the appropriate handler based on direction (horizontal scrolling goes to one handler and vertical scrolling goes to another). In the end, I hope to accomplish a UI feature much like:
image

So basically, I pipe from the surface to the mapper but the events are never making it to the mapper for some reason. I have setup a simple codepen to demonstrate: http://codepen.io/anon/pen/jEwpOG?editors=001.

Hi @jfizz -

Thank you for using Famous-Angular. So this is not a Famous-Angular issue. I just did a little QA with the Famo.us core guys and found out that EventMapper and EventFilter are not exactly working. Here is the GitHub issue under the Famo.us repo if you would like to follow it. They are working on this and it will be in a future release of Famo.us but not for a few weeks was my understanding. What this means that you will need to manually build this with something like GenericSync. I am going to start playing with that to see if I can get some sort of example pulled together but you should try this too. I know there are examples if GenericSync bring used in the Timbre Tutorial. I hope this is a good starting off point for you. I am going to close this issue as it is an issue with famo.us not famous-angular. I would like to continue the dialog here and try to get a working example of what you are trying to do into a CodePen using GenericSync.

Thanks,

Jordan

Thanks for the reply! This is very unfortunate. This situation seems like a proper fit for the event mapper. Working with a sync sounds like it could get messy but I may have to try that out. Regardless, I will definitely post any results I come up with.

Here is what I have so far, codepen. It's basically what you want with just click events on the email so i could figure out the resting states of open and closed. I have not implemented GenericSync. This will be my first time using it. Again this was a first stab so if you have a better idea please share and hopefully we can come up with something super cool :). Ill try to play around with the GenericSync today time permitting.

Awesome! Thanks so much for the help. Unfortunately, I do not have much time through the week but I should be able to take a look over the weekend. Thanks again for your time.

No worries. I'm in the same situation.

Sent from my iPhone

On Jan 28, 2015, at 10:50 PM, Jordan Scheller notifications@github.com wrote:

Awesome! Thanks so much for the help. Unfortunately, I do not have much time through the week but I should be able to take a look over the weekend. Thanks again for your time.


Reply to this email directly or view it on GitHub.

commented

Got it working! The key was to add the listeners which I plan to use, per the docs for the event mapper:

Trigger an event, sending to all mapped downstream handlers
* listening for provided 'type' key."

I was just confused about setting up a listener, which I think could definitely be documented clearer. Here is the working codepen: http://codepen.io/anon/pen/jEwpOG?editors=001. Just be sure to emulate touch in Chrome.