question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HOA — Higher Order Apps

See original GitHub issue

Higher Order Apps refers to the following pattern, in which foo, bar and baz are functions that take the app function and transform custom props into props app can work with.

baz(bar(foo(app)))({
  // Custom props!
})

or

app(baz(bar(foo({
  // Custom props!
}))))

That isn’t bad, but this would be much nicer!

app(foo)(bar)(baz)({
  // Custom props!
})

Now, that requires adding more bloat to core! 😭

So, what’s to do and can we find a middle ground?

Maybe!

compose(app)(foo)(bar)(baz)({
  // Custom props & profit!
})

The compose function can be implemented this way! ❤️

function compose(props, enhancers) {
  return typeof props === "function"
    ? enhancer => compose(enhancer, (enhancers || []).concat(props))
    : (enhancers || []).reduceRight((enhancer, reducer) => reducer(enhancer), props)
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:23 (18 by maintainers)

github_iconTop GitHub Comments

7reactions
SkaterDadcommented, Sep 26, 2017

I think this talk is relevant. Michael Jackson (of React-Router), advising against Higher Order Components, and I agree with most of his points. The arguments could apply to higher order apps in hyperapp, in my opinion. https://www.youtube.com/watch?v=BcVAq3YFiuc

I’m not sure I see the point in supporting higher-order apps? Is there a particular use-case in mind for this?

As @okwolf mentioned, you have to worry about merging props correctly. It re-introduces what mixins were doing to begin with, which seem to be on their way out? I can’t keep up 😕

2reactions
jorgebucarancommented, Sep 26, 2017

@jacktuck Mixins are just as evil. That’s why we are moving away from them in #219! 🏄

Read more comments on GitHub >

github_iconTop Results From Across the Web

The 33 Best HOA Software Solutions for Android 2022
Best HOA Apps for Android · PayHOA · AppFolio Property Manager · Buildium · Vantaca · Neigbrs · Wild Apricot · ONR app...
Read more >
Homeowners' Association Software: the Best Options in 2022
Mobile app; Violations management; Architectural review request management; Timely financial reporting. 6) FRONTSTEPS. Frontsteps HOA Software.
Read more >
Best HOA Apps for Android - 2022 Reviews & Comparison
Compare the Top HOA Apps for Android of 2022 · DoorLoop · Neigbrs by Vinteum · Raklet · Condo Control · Buildium ·...
Read more >
Best HOA Software - 2023 Reviews, Pricing & Demos
HOA software is software that manages homeowner associations. Features include board meeting scheduling, recording meeting minutes, ...
Read more >
Top HOA Software in 2022 - Slashdot
Find and compare the best HOA software in 2022 ; PayHOA. PayHOA, LLC. $49.00/month ; Condo Manager. Consultants Ingenium. $150.00/month/user. 2 Reviews ;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found