Skip to content

m00k/intersection-observer-grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

intersection-observer-grid

forces

- scroll
- navigate
- resize
- load page

actors

page

- handleFirstRender:
    - get feed data

container

- handeFirstRender
    - if (!location.hash) setLocationHash
    - setActiveCat
- handleActiveCatChanged
    - setLocationHash
    - setActiveCat

nav

- prev, next, nav clicked:
    - dispatch activeCatChanged({index, target})
- handleActiveCatChanged:
    - if (target !== self) scrollIntoView()
- handleResize:
    - scrollIntoView()

grid

- scroll: 
    - intersection observer -> dispatch activeCatChanged({index, target}) once settled (delay, throttle) to prevent race condition w/ nav
- handleResize:
    - scrollIntoView()
- handleActiveCatChanged:
    - if (target !== self) scrollIntoView()

Notes

CLI Commands

  • npm install: Installs dependencies

  • npm run dev: Run a development, HMR server

  • npm run serve: Run a production-like server

  • npm run build: Production-ready build

  • npm run lint: Pass TypeScript files using ESLint

  • npm run test: Run Jest and Enzyme with enzyme-adapter-preact-pure for your tests

For detailed explanation on how things work, checkout the CLI Readme.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published