You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I previously reported issue #43, where several places in the codebase had hardcoded references to Backbone.Model. That issue was fixed (thanks), but I've just run into a similar issue.
Epoxy currently uses two internal functions, isModel() and isCollection(), to determine how to handle binding source setup (per
). However, both those functions still have hardcoded references to Backbone.Model and Backbone.Collection.
I've started to use parts of the Ampersand library in my current codebase, including Ampersand-State (a forked and upgraded version of Backbone.Model). Amp.State still supports the same get()/set()/toJSON() API as Backbone.Model, so the core Epoxy binding logic should still work correctly. However, as currently written, the isModel() and isCollection() functions both fail when attempting to add an Amp.State instance to the binding context, as it is not a Backbone.Model.
I was able to get Epoxy and Ampersand-State to cooperate by hacking up my local copy of Epoxy to look like this:
I really don't like using locally-modified copies of dependencies, though, so it would be nice if there was a way to override the built-in logic.
A comment on the previous issue links to a fork commit that exposes several inheritance-related pieces on the public Epoxy object. That commit appears to predate the official commit for #43, but the approach looks reasonable.
So, would it be possible to expose isModel() and isCollection() publicly so that they could be overwritten?
The text was updated successfully, but these errors were encountered:
I previously reported issue #43, where several places in the codebase had hardcoded references to Backbone.Model. That issue was fixed (thanks), but I've just run into a similar issue.
Epoxy currently uses two internal functions, isModel() and isCollection(), to determine how to handle binding source setup (per
backbone.epoxy/backbone.epoxy.js
Line 636 in 7aeb9f7
I've started to use parts of the Ampersand library in my current codebase, including Ampersand-State (a forked and upgraded version of Backbone.Model). Amp.State still supports the same get()/set()/toJSON() API as Backbone.Model, so the core Epoxy binding logic should still work correctly. However, as currently written, the isModel() and isCollection() functions both fail when attempting to add an Amp.State instance to the binding context, as it is not a Backbone.Model.
I was able to get Epoxy and Ampersand-State to cooperate by hacking up my local copy of Epoxy to look like this:
I really don't like using locally-modified copies of dependencies, though, so it would be nice if there was a way to override the built-in logic.
A comment on the previous issue links to a fork commit that exposes several inheritance-related pieces on the public Epoxy object. That commit appears to predate the official commit for #43, but the approach looks reasonable.
So, would it be possible to expose isModel() and isCollection() publicly so that they could be overwritten?
The text was updated successfully, but these errors were encountered: