3 ms·
I could be mistaken, but I don't think you can have a "pure" functional front-end. I think even with something like mithril.js, you will have to run some comput
by rajangdavis 8y ago
I could be mistaken, but I don't think you can have a "pure" functional front-end. I think even with something like mithril.js, you will have to run some computation method to update changes in the view when some data changed.
I think the benefit of js functional programming is composability; you can build complicated functions from smaller, more focused functions. This ends up being easier to read and debug if you run into some unforeseen logic error.
It really depends on what you are building, but it's hard to avoid logic errors when working with the DOM explicitly. It's a lot easier to map over an empty array than to manipulate DOM elements that have been removed from the screen.