-
Notifications
You must be signed in to change notification settings - Fork 20
Allow filters to express implicit dependencies #53
base: master
Are you sure you want to change the base?
Conversation
```js myFilter = { filter: ... // The filter function. extraDeps: ... // A function that returns an array of observers. }; ```
@@ -213,6 +213,11 @@ | |||
fn = fn.toDOM; | |||
} | |||
|
|||
var extraDepsFn = fn.extraDeps; | |||
if (fn.filter) { | |||
fn = fn.filter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could just put the extraDeps property on function itself? Since in JS that's no big deal. That way the filter would be callable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would jive better w/ filters within elements too. I was trying to follow along with toDOM
/toModel
- not sure whether it's worth it though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think toDOM/toModel is for two-way bindings. Conceivably they could have different "extra deps"?
did you figure out:
... seems worth addressing (or at least understanding) I added my $0.02 but would be great to get thoughts from @rafaelw if he's around :) |
btw, the general idea here seems reasonable to me (give filters an easy a way to signal other dependencies they might have) |
...I didn't figure that |
Sorry for the latency. I just talked with Ian in person. I think the question here is whether That said, it seems to me like this is a bit of a band-aid over a larger On Tue, Sep 9, 2014 at 12:33 PM, John Messerly notifications@github.com
|
An example of where I'm using it: https://github.com/Polymore/more-routing/blob/master/polymer-expressions.html#L25-33