-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move obs(...args) to obs.get(...args) #8
Comments
Oh yeah. This old thing. I suppose I'm more attached to the "Observable as a function" thing for sentimental reasons. It would be a real shame to see it go, but not being able to have "name" and "length" keys really does suck. Keep in mind that this would mean you couldn't have a Hmmmmmmmm. I'll have to think about this. The real question is, what are the disadvantages? Are there any? |
yeah, so far the only disadvantage i see is the additional code to call an alternative is we change the "Struct" format so it's like |
Another other interesting side effect: We will no longer be assuming that functions are observables. Maybe check for presence of This will allow the |
mhm. i'm keen for using a magic key or global symbol like ah yep, cool. |
Thinking about this again. The biggest problem is this is a major breaking API change that would require refactoring a lot of projects. But here's an idea: modify This means that you can implement a custom mutant type that is not a function, but the old API is not broken in any way. It also means we can get the advantages of stricter @ahdinosaur you could create a This also means that any observable library could potentially integrate with mutant if it mapped the symbols correctly 😄 |
when using observables as both functions and values, there's a slight problem with how the details of
Function
cause this hack when converting between values and functions. basically you can't have an observable with propertiesname
orlength
, because those are part of the function.what if instead, we changed the API so that
obs()
. becameobs.get()
? this would be enough to fix the overlap. then an "observable" becomes an object with a.get
and.set
function.this would be a breaking change from
observ
. 😅The text was updated successfully, but these errors were encountered: