Better HN
topnewbestaskshowjobs
Log inSign up

mikaelbr

11 karma · joined Sep 24, 2013 (13y ago) · 10 submissions

Submissions

1.

Abstracting the DOM by making ad-hoc React-like library(medium.com ↗)

2 points · by mikaelbr · 7y ago · discuss

2.

ES2015 (ES6) Features Commonly Used with Functional Style React(open.bekk.no ↗)

1 points · by mikaelbr · 11y ago · discuss

3.

Scaling Front End Build Steps by Necessity(open.bekk.no ↗)

3 points · by mikaelbr · 11y ago · discuss

comment 11y ago · link · parent

This topic is also covered in the talk from JSConf Budapest: "Functional UI and Unidirectional Dataflow": https://www.youtube.com/watch?v=JNMWi7Z0Ssg

comment 11y ago · link · parent

Component here is just to illustrate that the type is of a view component, and due to it being implemented on top of React. `component()` is a factory/syntactic sugar on top of React allowing you to have referentially transparent components (as you get arguments passed to the render function).

In time, React hopefully (and probably) gets support for stateless functions without the syntactic sugar (https://github.com/reactjs/react-future/blob/master/01%20-%2...). This will be supported when React adds support for functions returning VDOM elements.

comment 11y ago · link · parent

With Omniscient there is a syntactic sugar on top of React class factories, which encourages to think of components as pure and smaller/more focused functions. This tries to lead more to simpler and composable components.

comment 12y ago · link · parent

Yeah. The main part here is using immutable structures from the top, having cursors to sub-components with information about only the relevant data for that component, and have a way of re-start the loop when a data has changed.

Sometimes, though, we need to communicate to a parent or ancestor (e.g. to delete an item in a list). For that we can simply use events (or possibly callbacks) passed as statics to components. (Statics are values that doesn't trigger a component update when changed.)

comment 12y ago · link · parent

It doesn’t really relate to the Flux architecture directly. You could probably use something like Flux in addition to Omniscient. In the same way that Flux encourages a continuous loop with data from the top, Omniscient has a single direction of data flow. But you could easily use dispatchers with stores to communicate in the other direction, like with the Flux architecture.

Omniscient is a very small library, only providing a “smarter” shouldComponentUpdate for use with Immutable.js cursors and a wrapper for easily creating components with renderers and composability with mixins in focus. See the documentation to see more about Omniscients rationale: http://omniscientjs.github.io/documentation/

9.

Show HN: Omniscient: Abstracting React – fast top down render of immutable data(omniscientjs.github.io ↗)

11 points · by mikaelbr · 12y ago · 4 comments

comment 13y ago · link · parent

After some feedback the example (the piano implementation) is updated to include black keys.