Skip to content

Commit 56509a3

Browse files
committed
refactor: streamline kernel plugin registration for improved readability
1 parent 77bfe92 commit 56509a3

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

examples/app-react-crud/src/mocks/browser.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,22 @@ export async function startMockServer() {
2323

2424
// Create kernel with MiniKernel architecture
2525
kernel = new ObjectKernel();
26+
27+
// Register ObjectQL engine
28+
await kernel.use(new ObjectQLPlugin());
29+
30+
// Register the driver
31+
await kernel.use(new DriverPlugin(driver, 'memory'));
32+
33+
// Load todo app config as a plugin
34+
await kernel.use(new AppPlugin(todoConfig));
2635

27-
kernel
28-
// Register ObjectQL engine
29-
.use(new ObjectQLPlugin())
30-
31-
// Register the driver
32-
.use(new DriverPlugin(driver, 'memory'))
33-
34-
// Load todo app config as a plugin
35-
.use(new AppPlugin(todoConfig))
36-
37-
// MSW Plugin (intercepts network requests)
38-
.use(new MSWPlugin({
39-
enableBrowser: true,
40-
baseUrl: '/api/v1',
41-
logRequests: true
42-
}));
36+
// MSW Plugin (intercepts network requests)
37+
await kernel.use(new MSWPlugin({
38+
enableBrowser: true,
39+
baseUrl: '/api/v1',
40+
logRequests: true
41+
}));
4342

4443
await kernel.bootstrap();
4544

0 commit comments

Comments
 (0)