Open mfrawley opened 10 years ago
Yeah, it's a bit tough to use mutability. You have a few options. Here's two.
Use something like underscore to update it.
let _ = require 'underscore'
let show el = _.extend el.style {display: 'block'}
Use something like fantasy-lenses to still deal with immutability.
let ol = (require 'fantasy-lenses').objectLens
let show2 el =
(((ol 'style') .andThen(ol 'display')).run el).set 'block'
e.g. this won't work let show (el:DomElement) = el.style.display = 'block'