<commit_before>Documentation for the Terrific module

# *media-event*


## Summary

Media query "events" for JS, based on Terrific connectors.  
For an example how to consume the events see _Media-Event-Consumer_ module, which implements dynamic loading of images based on the media queries.

## Need to know

Depends on Enquire.js and for older browsers a matchMedia/matchMedia.addListener polyfill. Both are already present in `lib/`.

The connector callback `onViewportChange` receives a simple data object containing two properties:
- `query` {Object}
    - `query.name` contains the viewport name
    - `query.string` the matched media query.
- `state` {'match'|'setup'} -  _setup_ is sent during page load only, _match_ during pge load and all viewport changes.<commit_msg>Correct documentation for Enquire's "setup" and "match".<commit_after>Documentation for the Terrific module

# *media-event*


## Summary

Media query "events" for JS, based on Terrific connectors.  
For an example how to consume the events see _Media-Event-Consumer_ module, which implements dynamic loading of images based on the media queries.

## Need to know

Depends on Enquire.js and for older browsers a matchMedia/matchMedia.addListener polyfill. Both are already present in `lib/`.

The connector callback `onViewportChange` receives a simple data object containing two properties:
- `query` {Object}
    - `query.name` contains the viewport name
    - `query.string` the matched media query.
- `state` {'match'|'setup'} -  _setup_ is sent for first matches only, _match_ for first and subsequent matches.
{'fraction_non_alphanumeric': 0.07528230865746549, 'fraction_numerical': 0.0, 'mean_word_length': 4.462328767123288, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6861506', 'n_tokens_mistral': 430, 'n_tokens_neox': 419, 'n_words': 199}