![Node.js Adds Experimental Support for TypeScript](https://cdn.sanity.io/images/cgdhsj6q/production/5fa307ef6135347f38e009b4da8cebcb3b9a386a-1948x1336.png?w=400&fit=max&auto=format)
Security News
Node.js Adds Experimental Support for TypeScript
Node.js has added experimental support for TypeScript, a move that highlights the growing importance of TypeScript in modern development.
ember-deferred-content
Advanced tools
Readme
ember install ember-deferred-content
{{! This assumes that post has an async relationship called comments}}
{{#deferred-content post.comments as |d|}}
{{#d.settled}}
<h2>Comments</h2>
{{/d.settled}}
{{#d.pending}}
<img src="spinner.gif">
{{/d.pending}}
{{#d.fulfilled as |comments|}}
<ul>
{{#each comments as |comment|}}
<li>{{comment.author}} said: {{comment.body}}
{{/each}}
</ul>
{{/d.fulfilled}}
{{#d.rejected as |reason|}}
Could not load comments: {{reason}}
{{/d.rejected}}
{{/deferred-content}}
{{! or using ifs}}
{{#deferred-content promise=post.comments as |d|}}
{{#if d.isSettled}}
<h2>Comments</h2>
{{/if}}
{{#if d.isPending}}
<img src="spinner.gif">
{{/if}}
{{#if d.isFulfilled}}
<ul>
{{#each d.content as |comment|}}
<li>{{comment.author}} said: {{comment.body}}
{{/each}}
</ul>
{{/if}}
{{#if d.isRejected}}
Could not load comments: {{d.content}}
{{/if}}
{{/deferred-content}}
ember-deferred-content
takes the promise you need to resolve to show
your content, and yields 4 subcomponents that you can use to show
content during the different states of your promise
d.settled
: displays the content when the promise is resolved or
rejectedd.pending
: displays the content before the promise is resolved or
rejectedd.fulfilled
: displays the content only when the promise is
resolved; yields the result of the promised.rejected
: displays the content only when the promise is rejected;
yields the result of the promiseIt also sets a series of flags:
d.isSettled
: true if the promise is resolved or rejectedd.isPending
: true until the promise is resolved or rejectedd.isFulfilled
: true if the promise is resolvedd.isRejected
: true if the promise is rejectedd.content
: the return value of the resolved/rejected stateThis addon will work on Ember versions 2.3.x
and up only, due to use
of contextual
components
and the (hash
helper.
git clone
this repositorynpm install
bower install
npm test
(Runs ember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
FAQs
Fancy pants handling of async content
The npm package ember-deferred-content receives a total of 140 weekly downloads. As such, ember-deferred-content popularity was classified as not popular.
We found that ember-deferred-content demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Node.js has added experimental support for TypeScript, a move that highlights the growing importance of TypeScript in modern development.
Product
Check out what's new at Socket with our Product Changelog. It tracks all public-facing updates, improvements, and fixes so you can take full advantage of our features.
Security News
In the latest Risky Biz Podcast episode, Socket CEO Feross Aboukhadijeh discussed the limitations of the National Vulnerability Database (NVD) in addressing the modern risks associated with using open source package registries.