Skip to content

Commit 84dd8c3

Browse files
griest024gracetxgao
authored andcommitted
feat(driver): add base in-memory driver (graycoreio#3147)
1 parent 92b30e9 commit 84dd8c3

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Diff for: libs/driver/in-memory/src/driver/base.class.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { InMemoryBackendConfigArgs } from 'angular-in-memory-web-api';
2+
3+
/**
4+
* The base class for in-memory drivers.
5+
*/
6+
export abstract class DaffInMemoryDriverBase {
7+
/**
8+
* The URL of the corresponding backend.
9+
*/
10+
protected readonly url = `/${this.config.apiBase}/${this.collectionName}`;
11+
12+
constructor(
13+
private config: InMemoryBackendConfigArgs,
14+
private collectionName: string,
15+
) {}
16+
}

Diff for: libs/driver/in-memory/src/driver/public_api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './base.class';

Diff for: libs/driver/in-memory/src/public_api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './backend/public_api';
2+
export * from './driver/public_api';

0 commit comments

Comments
 (0)