-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial Todos #859
Comments
How to do Polling with a resource: import { resourceFactory, resource } from 'ember-resources';
class State {
// this part I don't know, and is specific to your use case
@tracked foo;
@tracked bar;
}
const Status = resourceFactory((pollingInternal = 10_000) => {
return resource(({ on }) => {
let state = new State();
async function getStatus() {
// make your request here
state.foo = "foo";
}
let interval = setInterval(getStatus, pollingInterval);
on.cleanup(() => clearInterval(interval));
return state;
});
}); and then in a component or something: {{#let (Status) as |status|}}
{{status.foo}}
{{/let}} or in js class {
@use status = Status;
get foo() {
return this.status.foo;
}
} Wait for composition to be more widely supported in ember-resources?const Status = resourceFactory((pollingInternal = 10_000) => {
return resource(({ on, use }) => {
let time = cell(0);
let request = use(TrackedFunction(async () => {
// ...
}, time));
let interval = setInterval(() => time.current++, pollingInterval);
on.cleanup(() => clearInterval(interval));
return () => request.current;
});
}); but this isn't implemented yet for TrackedFunction, and I think may have some ergonomics / coherance issues when done this way -- still need to work through it. |
This comment was marked as resolved.
This comment was marked as resolved.
Convert to tutorial: |
Fancy CSS effects
|
If you absolutely must |
Topics to cover
|
Convert to tutorial:
|
more glimmer features:
j/k: https://discuss.emberjs.com/t/the-status-of-unbound/11187 no one should use this |
Integrations with bonkers libraries |
"an" implementation for throttle here |
casting: @value={{String f.value}}
@value2={{Boolean f.value}} |
Custom reactive collections that are efficient on memory |
From socials:
|
add proper
hopefully one of those two libraries allows for browser-only usage |
ember / framework concepts:
|
This issue is for collecting ideas, topics, and resources for expanding https://tutorial.glimdown.com.
Anyone is free to PR changes to the tutorial, and the more new to ember, or new to open source, the better.
Here are some example PRs for how others have contributed so far:
localCopy: use with modals
composing resourcessanitizing HTML
native JS State / encapsulation
Convert to tutorial:
The text was updated successfully, but these errors were encountered: