Skip to content

Instantly share code, notes, and snippets.

@victorvoid
Last active August 16, 2018 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorvoid/aced35e414007eb90d1571673c4d6467 to your computer and use it in GitHub Desktop.
Save victorvoid/aced35e414007eb90d1571673c4d6467 to your computer and use it in GitHub Desktop.
import _ from 'ramda'
import { IO } from 'ramda-fantasy'
const IOwindow = IO(() => window)
IOwindow
.map(_.prop('location'))
.map(_.prop('href'))
.map(_.split('/'))
// IO(["http:", "", "localhost:8000", "blog", "posts"])
const $ = selector => IO(() => document.querySelectorAll(selector))
$('#container')
.map(_.head)
.map(div => div.innerHTML)
// IO('I am some inner html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment