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.

Recommended way to check for Properties

See original GitHub issue

Lets say I have this Model for Picture component:

let Model = Cycle.createModel(Props => ({
  src$: Props.get("src$").startWith("#"),
  title$: Props.get("title$").startWith(""),
  favorite$: Props.get("favorite$").startWith(false),
}));

In React we have propTypes to declare required properties and their expected types. What do you think is the best direction to implement that in Cycle?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ivan-kleshnincommented, May 9, 2015

@tel thank you very much for such detailed explanation.

I’ve tried Flow a few times. I found it less mature, but I’d be tempted to use it exactly and only for its treatment of nulls. They are such a terrible thing to have in a language.

As I remember from theory it’s not a null on itself being terrible but default “nullability” of all types in JS / Java. Anyway, it’s an interesting point in Flow.

I think ultimately Flow wants to be a type-checking layer atop JavaScript while TypeScript wants to be a new language which just so happens to superset JavaScript. I feel the latter is a better place to stand.

New language makes a difference, yes. There are pros and cons. I would rather go with ClojureScript, I’m really tired of JS, but there are a lot more libraries, much more job opportunities in JS. And some super-valueable tools like Webpack are unique to JS ecosystem. ClojureScripts guys seem to stuck with React so who is really on the cutting edge? – that’s an open question.

0reactions
telcommented, May 9, 2015

default “nullability” of all types in JS / Java

Yeah, that’s one way to see it. The technical form I like the most is the notion that all types are “pointed” in that they all contain a special value “null”. It turns out that it’s rare to have semantics amenable to this treatment (but consider mathematical groups which have “null” but handle it gracefully).

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Helpful House Hunting Apps for 2023 - Real Estate
With photos, maps and property history, these apps make searching for your next home easy.
Read more >
The Best Way to Check House Prices in Your Area
Click on “recently sold,” and then do an “advanced search” to streamline your parameters. Another source is www.zillow.com. Under “Homes,” scroll to the...
Read more >
How to determine home value and why it matters - NerdWallet
Use online tools, comparable properties and appraisals to determine value and buy, sell or refinance like a pro.
Read more >
11 Best Foreclosure Sites for Finding Properties - Kiplinger
Realtor.com, a popular website used by new-home seekers or sellers, can help you find foreclosures. You can focus your search using a zip...
Read more >
4 Best Ways To Determine Home Value - Rocket Mortgage
Real estate comps are comparable homes in the area where you're looking to sell. If you check online sites, you can find information...
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