Added state management

This commit is contained in:
2022-05-19 22:57:38 +03:00
parent 68f9600e08
commit b3aa31a3f6
12 changed files with 111 additions and 10 deletions

View File

@@ -1,8 +1,22 @@
import { createViewportObserver } from '@solid-primitives/intersection-observer';
import { useStore } from '../../store/index';
import styles from './Projects.module.css';
export default () => {
const [, { setVisibleChapter }] = useStore();
const [add] = createViewportObserver();
return (
<div class={styles.Projects}>
<div
ref={el => {
add(el, (event) => {
console.log(event.isIntersecting);
setVisibleChapter('projects');
});
}}
class={styles.Projects}
>
</div>
)