-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #960 from NullVoxPopuli/provide-the-ability-to-imm…
…ediately-return-used-resources Resolves #958
- Loading branch information
Showing
10 changed files
with
171 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
"ember-resources": patch | ||
--- | ||
|
||
Resolves: https://github.com/NullVoxPopuli/ember-resources/issues/958 | ||
|
||
`use`d Resources can now be immediately returned from other resources. | ||
|
||
```js | ||
const Clock = resource(({ use }) => { | ||
return use(Instant({ intervalMs: 1000 }); | ||
}); | ||
|
||
const Stopwatch = resource(({ use }) => { | ||
return use(Instant({ intervalMs: 0 }); | ||
}); | ||
|
||
<template> | ||
<time>{{Clock}}</time> | ||
|
||
MS since Epoch: {{Stopwatch}} | ||
</template> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.