chinedufn / solid-state

Trigger listener functions when your state changes
8 stars 1 forks source link

Don't use prototypes #4

Closed bendrucker closed 9 years ago

bendrucker commented 9 years ago

See how observ is written (or ear for that matter). You should return a function that returns state when called w/out a listener, not provide extra hooks.

chinedufn commented 9 years ago

You should return a function

Hmm very interesting. I'm not so sure about this. Since this isn't a common or immediately recognizable pattern I'm leaning towards keeping the extra hook for readability.

chinedufn commented 9 years ago

Since this isn't a common or immediately recognizable pattern I'm leaning towards keeping the extra hook for readability.

Gave this some thought. While I definitely see the pros of something like observ(), I'm going to keep it as is.


Thanks!!