31 lines
785 B
TypeScript
31 lines
785 B
TypeScript
import { EntityDict } from '@project/oak-app-domain';
|
|
import { BasicFeatures, Feature } from 'oak-frontend-base';
|
|
import Sample from './Sample';
|
|
import Console from './Console';
|
|
import { createService } from 'oak-frontend-base/es/aspects/AspectService';
|
|
|
|
export function create(
|
|
features: BasicFeatures<EntityDict>
|
|
) {
|
|
const {
|
|
cache,
|
|
localStorage,
|
|
token,
|
|
} = features;
|
|
|
|
const sample = new Sample(cache);
|
|
const console = new Console(cache, localStorage, token, () => ({
|
|
id: 1,
|
|
name: 1,
|
|
}));
|
|
const aspect = createService<EntityDict, MergeAspectDict>(cache);
|
|
|
|
return {
|
|
sample,
|
|
console,
|
|
aspect: aspect as typeof aspect & Feature,
|
|
};
|
|
}
|
|
|
|
export type FeatureDict = ReturnType<typeof create>;
|