Skip to content

Commit 8ed4dd1

Browse files
committed
The builder had to be registered to the helper manager
1 parent 76b47f4 commit 8ed4dd1

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

ember-resources/src/intermediate-representation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export class Resource<Value> {
193193
}
194194
}
195195

196-
setHelperManager(ResourceManagerFactory, Resource);
196+
setHelperManager(ResourceManagerFactory, Builder.prototype);
197197

198198
function isReactive<Value>(maybe: unknown): maybe is Reactive<Value> {
199199
return typeof maybe === 'object' && maybe !== null && CURRENT in maybe;

test-app/tests/core/rendering-test.gts

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ import { cell, resource, resourceFactory } from 'ember-resources';
99
module('Core | Resource | rendering', function (hooks) {
1010
setupRenderingTest(hooks);
1111

12-
module('cleanup with wrapping factory/blueprint', function() {
12+
module('cleanup with wrapping factory/blueprint', function () {
1313
test('a generated interval can be cleared', async function (assert) {
1414
const id = cell(0);
1515
const condition = cell(true);
1616

17-
const poll = resourceFactory((id: number) => {
17+
const poll = (id: number) => {
1818
return resource(({ on }) => {
1919
assert.step(`setup: ${id}`);
2020
on.cleanup(() => assert.step(`cleanup: ${id}`));
2121

2222
return id;
2323
});
24-
});
24+
};
2525

26-
await render(
27-
<template>
28-
<button type="button" {{on 'click' condition.toggle}}>Toggle</button><br />
26+
resourceFactory(poll);
2927

30-
{{#if condition.current}}
31-
{{poll id.current}}
32-
{{/if}}
33-
</template>
34-
);
28+
await render(<template>
29+
<button type="button" {{on "click" condition.toggle}}>Toggle</button><br />
30+
31+
{{#if condition.current}}
32+
{{poll id.current}}
33+
{{/if}}
34+
</template>);
3535

3636
assert.verifySteps(['setup: 0']);
3737

0 commit comments

Comments
 (0)