Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(selectors): remove unused selectors
Browse files Browse the repository at this point in the history
fix(selectors): remove unused selectors
  • Loading branch information
Metnew committed Feb 18, 2018
1 parent 56a26a7 commit a5600f4
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/common/selectors/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
// @flow
import type {State as AuthState} from 'reducers/auth'
import type {State as LayoutState} from 'reducers/layout'
import type {State as EntitiesLinksState} from 'reducers/links'
import type {GlobalState} from 'reducers'
import {createSelector} from 'reselect'

export const getAuthState = (state: GlobalState): AuthState => state.me.auth
export const getLayoutState = (state: GlobalState): LayoutState => state.layout
export const getEntitiesLinksState = (state: GlobalState): EntitiesLinksState => state.entities.links
export const isLoaded = state => state.fetchStatus === 'loaded'
export const getLayoutState = state => state.layout
export const getEntitiesLinksState = state => state.entities.links

const defaultWindowInnerWidth = 1025
export const getWindowInnerWidth = (window: Object): number => {
const defaultWindowInnerWidth = 1025
return window && window.innerWidth
? window.innerWidth
: defaultWindowInnerWidth
}

export const computeLayoutMobileStatuses = ({innerWidth}) => {
const isMobile: boolean = innerWidth < 993
const isMobileXS: boolean = innerWidth < 481
const isMobileSM: boolean = innerWidth > 480 && innerWidth < 767
return {isMobileSM, isMobileXS, isMobile}
}

export const getLayoutMobileStatuses = createSelector(
getLayoutState, computeLayoutMobileStatuses
)

0 comments on commit a5600f4

Please sign in to comment.