Skip to content

ember-resources@6.1.1

Compare
Choose a tag to compare
@github-actions github-actions released this 23 Jun 11:49
· 503 commits to main since this release
54d3ea0

Patch Changes

  • #925 e320cf8 Thanks @NullVoxPopuli! - Fix situation where, when composing with blueprint/factory-creted Resources, the owner was not passed to the tusedd resource.

    Example from the added test
    const Now = resourceFactory((ms = 1000) =>
      resource(({ on }) => {
        let now = cell(nowDate);
        let timer = setInterval(() => now.set(Date.now()), ms);
    
        on.cleanup(() => clearInterval(timer));
    
        return () => now.current;
      })
    );
    
    const Stopwatch = resourceFactory((ms = 500) =>
      resource(({ use }) => {
        let time = use(Now(ms));
    
        return () => format(time);
      })
    );
    
    await render(<template><time>{{Stopwatch 250}}</time></template>);

    The owner is part of the hooks API for resource and an error is thrown when it is undefined - regardless if used.

    const Demo = resource(({ on, use, owner }) => {
      // ...
    });