Farmbot-Web-App/frontend/__test_support__/fake_resource.ts

9 lines
296 B
TypeScript
Raw Normal View History

import { TaggedResource } from "farmbot";
2018-10-30 15:43:23 -06:00
import { arrayUnwrap } from "../resources/util";
import { newTaggedResource } from "../sync/actions";
2017-07-18 14:39:38 -06:00
2018-10-30 15:43:23 -06:00
export function fakeResource<T extends TaggedResource>(kind: T["kind"],
body: T["body"]): T {
2018-10-30 15:43:23 -06:00
return arrayUnwrap(newTaggedResource(kind, body));
2017-07-18 14:39:38 -06:00
}