Skip to content

Commit

Permalink
feat(mixin): alias screen height/width
Browse files Browse the repository at this point in the history
  • Loading branch information
zachnthebox committed Mar 26, 2018
1 parent feedb39 commit 66d4dea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addon/mixins/resize-aware.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import Mixin from '@ember/object/mixin';
import { readOnly } from '@ember/object/computed';
const { floor } = Math;

export default Mixin.create({
resizeEventsEnabled: true,
resizeDebouncedEventsEnabled: true,

screenWidth: readOnly('resizeService.screenWidth'),
screenHeight: readOnly('resizeService.screenHeight'),

_oldViewWidth: null,
_oldViewHeight: null,
_oldViewWidthDebounced: null,
Expand Down

0 comments on commit 66d4dea

Please sign in to comment.