Skip to content

Add a * select to match all changes. Fixes #23.#25

Open
xzyfer wants to merge 1 commit into
JoshBarr:masterfrom
xzyfer:wip/catch-all-context
Open

Add a * select to match all changes. Fixes #23.#25
xzyfer wants to merge 1 commit into
JoshBarr:masterfrom
xzyfer:wip/catch-all-context

Conversation

@xzyfer

@xzyfer xzyfer commented Jul 25, 2013

Copy link
Copy Markdown
Contributor

This pull request adds a * context that acts as a catch all.

var queries = [
    {
        context: 'mobile',
        match: function() {
            console.log('Mobile callback. Maybe hook up some tel: numbers?');
        },
        unmatch: function() {
            // We're leaving mobile.    
        }
    },
    {
        context: '*',
        match: function() {
            console.log('Changed breakpoint.');
        }
    }
];
// Go!
MQ.init(queries);
</script>

Now Changed breakpoint. will also be logged to the console any time any break point is matched.

@xzyfer

xzyfer commented Jul 25, 2013

Copy link
Copy Markdown
Contributor Author

Fixes #23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant