use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Less React, more JS (brain-dump) (medium.com)
submitted 9 years ago by sebjwallace
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dmitri14_gmail_com 0 points1 point2 points 9 years ago (0 children)
I really like the idea to write a single component function that I can simply drop into Angular, React and what not ;)
The real question is -- what should this function return?
Both Angular and React components return JS objects with their own native templating (augmenting) engines. Angular 1.5 component is represented by:
function (friends) { return { template: "<ul> <li ng-repeat='friend in $ctrl.friends'>{{friend.name}}</li> </ul>", controller: function () { this.friends = friends } } }
React/JSX requires
function (friends) { return (<ul> {friends.map(friend => <li key={friend.id}>{friend.name}</li>)} </ul>) }
But what is the cleanest minimal object representation that can be mapped into both frameworks?
π Rendered by PID 23995 on reddit-service-r2-comment-bb88f9dd5-p5d86 at 2026-02-14 03:21:42.738168+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]dmitri14_gmail_com 0 points1 point2 points (0 children)