Make Store Utility

Loading "Make Store Utility"
πŸ‘¨β€πŸ’Ό We want to make this utility generally useful so we can use it for any media query. So please stick most of our logic in a makeMediaQueryStore function and have that return a custom hook people can use to keep track of the current media query's matching state.
It'll be something like this:
export function makeMediaQueryStore(mediaQuery: string) {
	// ...
}

const useNarrowMediaQuery = makeMediaQueryStore('(max-width: 600px)')

function App() {
	const isNarrow = useNarrowMediaQuery()
	// ...
}

Please set the playground first

Loading "Make Store Utility"
Loading "Make Store Utility"

Access Denied

You must login or register for the workshop to view and run the tests.

Check out this video to see how the test tab works.