This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Taylor Wright
Posted Nov 29 - Read on Facebook

What is the scope of the handler function when called?
How can it retain the initial scope?
How can you pass arguments to the handler?


Taylor Wright

That's a good start, but only part way there for me. I'm still at a point where I have to run coffeescript through to start making sense of it.
Lets say I have an instance of a module that extends Layer and I want to throttle call's to the module's "draw(param)" method. Can you show an example of what that would look like?

Marc Krenn

hey Taylor,

Here's is an example I've made for you:
Hope that clear things up a bit :)


Concerning the question regarding the module, I think it might be the simplest solution to add the Utils.throttle to the corresponding method within the module itself.

So, open the module up in a code-editor of your choice and search for "draw = (param) ->". Then, insert Utils.throttle in front of the argument:

draw = Utils.throttle 1, (param) ->

Taylor Wright

Marc, I appreciate the help but I'm still struggling with scope and modules. I've posted a new question and included the working files. Maybe if we're looking at the same same example it'd help. [UPDATED]

Read the entire post on Facebook