Skip to content
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

can-fixture falls back to legacyStore if passed a mismatched version of can-set ~3 #45

Open
Bajix opened this issue Jun 15, 2016 · 1 comment

Comments

@Bajix
Copy link

Bajix commented Jun 15, 2016

If a version of can-set other than what's internally loaded within can-fixture is used, then can-fixture will revert to using the legacy store. There should be a strategy to avoid this, as it makes otherwise valid code behave unexpectedly.

Store.make = function (count, make, algebra) {
    /*jshint eqeqeq:false */
    // check if algebra was passed
    var isNew = false;
    if( count instanceof canSet.Algebra || make instanceof canSet.Algebra || algebra instanceof canSet.Algebra ) {
        isNew = true;
    }
    if(!isNew) {
        return legacyStore.apply(this, arguments);
    }
@justinbmeyer
Copy link
Contributor

The solution here would be to duck-type an algebra. Perhaps checking what's needed by store : getSubset and such.

@justinbmeyer justinbmeyer added the p3 label Sep 1, 2016
@justinbmeyer justinbmeyer changed the title can-fixture falls back to legacyStore if passed a mismatched version of can-set can-fixture falls back to legacyStore if passed a mismatched version of can-set ~3 Sep 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants