Skip to content

Instantly share code, notes, and snippets.

@victorvoid

victorvoid/composability-example07.js Secret

Last active Aug 16, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.