Skip to content

Get the document body dimensions in a flyd stream every time the user resizes the window.

Notifications You must be signed in to change notification settings

jayrbolton/flyd-windowresize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generate a flyd stream for document size, in streams of pairs of [document.body.offsetWidth, document.body.offsetHeight]. Each pair is pushed to the stream whenever the user resizes their window.

import windowStream from 'flyd-windowresize'

windowStream() // [100, 200]
// user resizes window...
windowStream() // [400, 500]

halfSize$ = flyd.map(
  (pair) => [pair[0] / 2, pair[1] / 2]
, windowStream )

About

Get the document body dimensions in a flyd stream every time the user resizes the window.

Resources

Stars

Watchers

Forks

Packages

No packages published