NullVoxPopuli / limber

Glimdown playground for documentation, demos, etc
https://limber.glimdown.com
MIT License
44 stars 21 forks source link

tutorial todos #859

Open NullVoxPopuli opened 1 year ago

NullVoxPopuli commented 1 year ago

Convert to tutorial:

NullVoxPopuli commented 1 year ago

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? ```js 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.
NullVoxPopuli commented 1 year ago

Convert to tutorial:

NullVoxPopuli commented 1 year ago

Convert to tutorial:

NullVoxPopuli commented 1 year ago

Fancy CSS effects

NullVoxPopuli commented 1 year ago

If you absolutely must

NullVoxPopuli commented 1 year ago

Topics to cover

NullVoxPopuli commented 1 year ago

Convert to tutorial:

NullVoxPopuli commented 10 months ago

more glimmer features:

j/k: https://discuss.emberjs.com/t/the-status-of-unbound/11187

no one should use this

NullVoxPopuli commented 9 months ago

Integrations with bonkers libraries

NullVoxPopuli commented 9 months ago

"an" implementation for throttle here

NullVoxPopuli commented 8 months ago

casting:

@value={{String f.value}}
@value2={{Boolean f.value}}
NullVoxPopuli commented 8 months ago

Conditional attribute rendering: https://limber.glimdown.com/edit?c=MQAgMglgtgRgpgJxAUQCYQC4HsEChfCgCCGGCEMArhnCAnAHaqIQMDm%2BA8gA6MgYALWgGMsDAM5YANrWwhxcWvSaI4qEFmrdquAAb62AK3EgpEAG5xcAHhpRuUgIY0AfDdbaMIKJSkYIDnAAvADeIQBmjlIKAL4xIKjOjgC0ANasqEEARJHRcFn8AJ682eEQMllu1h7U3r7%2BgaEhZJRwcQlJaRnZLflFJTnl%2BVU1Xj5%2BATJNlCplDGrtiRgp6UzZM8xzagUYxcGDFSMMnnUTjWEMvlKLnauZWZdSUjt7pUOV7se14w1TYVlZG7LLprLJwey7ZLiMisNgvAZlQ42AD0dgczjgbn0ulwQA&format=glimdown

NullVoxPopuli commented 8 months ago

Reactive collections: https://limber.glimdown.com/edit?c=MQAgSgpghgxgLgSwG4RAZQnA9AWSgBwChCALOOfAZwC4ss4B3BciAJwDoYB7AWy3wCurAUgBWAEwhIslOFDgDKWAIwB2AMzKAbAA5VO9QCYtWgAwAWZeYCcy68QAGTgOajKIADbIIhBD3xcrHAgAN4gACqssADWEOJ4%2BAA0EVEwseIYwQC%2BIABmrLwgAORwqekAtABGAggecOUIAHaURQDcvv6BwWFcjSA5%2BYVFAAIQPJVsWDxc4gi5CGxtxB6YIJSrALwgjRAMKTFxmQAUAJTtK8E8BCBbO3uRB-EEp%2B2EuQKN8Ai9IFDi4uEuMcTqFCCA1ph2H9xEc8HASOwoo1xLxTmdCFk3h8vj9oYCEqdQeCrvh2Os4LD5AikSieKdkg4kFAPAIIOUACQhOHUqDI1EnLIOdGYwgAHjgY3wHnkEAAfGCQKL5hAPOJybLRStnBBkbLyaKsFqdeJ5eDwaLquQfiEQj8ijAvGkir9-oDMlksrKAIL-A2WuC9DWVVims024DQGAkCHBKDuAA%2BzDG8Y9CrN4JtSZ4HotIbToRCWEjJFT5qwytV6oVCqVC0rmA1Rt1JINTZN%2BYtAitfRtdodCCdLoBXASHu9vqw-sDudDGZCEdgJAafRJvwTsQAniAmSyICnMemwyFNx6QNQCzvWTng7OC0XF8vS4ry3W1Q3iAaJf5pRL5U4HEAA&format=glimdown

NullVoxPopuli commented 6 months ago

The lifecycle of resources

NullVoxPopuli commented 6 months ago

Custom reactive collections that are efficient on memory demo here

NullVoxPopuli commented 4 months ago

Passing the constantly-reactive value from a resource to a helper demo here

and the short way: demo here

NullVoxPopuli commented 4 months ago

From socials:

NullVoxPopuli commented 1 month ago

add proper <style> tutorial chapters.

hopefully one of those two libraries allows for browser-only usage

NullVoxPopuli commented 4 weeks ago

ember / framework concepts: