Skip to content

Commit

Permalink
✨ (breakpoints) more stuff that should have happened in last patch
Browse files Browse the repository at this point in the history
  • Loading branch information
davejtoews committed Aug 21, 2020
1 parent 707c385 commit 9f6928e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@evanshunt/derekstrap",
"version": "0.1.6",
"version": "0.1.7",
"description": "A base layout and styles library by Evans Hunt",
"main": "dist/main.js",
"sass": "_index.scss",
Expand Down
9 changes: 6 additions & 3 deletions src/Breakpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ const Breakpoints = {
eventEmitter: debounce(() => {
const newBreakpoint = Breakpoints.getCurrent();
if (newBreakpoint !== Breakpoints.currentBreakpoint) {
const oldBreakpoint = Breakpoints.currentBreakpoint;
Breakpoints.currentBreakpoint = newBreakpoint;
Breakpoints.current = Breakpoints.get();

window.dispatchEvent(new CustomEvent('breakpointChange', {
detail: {
breakpoint: newBreakpoint,
lastBreakpoint: Breakpoints.currentBreakpoint
breakpoints: breakpoints.current,
lastBreakpoint: oldBreakpoint
}
}));
Breakpoints.currentBreakpoint = newBreakpoint;
Breakpoints.current = Breakpoints.get();
}
}, 50),
};
Expand Down

0 comments on commit 9f6928e

Please sign in to comment.