Update README

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2023-03-02 15:12:54 +02:00
1 parent 86fe5e6d14
commit 046d72b99f
2 files changed
+60 -7

No files matched your search

@@ -1,3 +1,35 @@
# @k8slens/application-for-electron-main
TBD
This Feature extends `@k8slens/application` with Electron specifics.
# Usage
```bash
$ npm install @k8slens/application-for-electron-main
```
```typescript
import { applicationFeature, startApplicationInjectionToken } from "@k8slens/application";
import { applicationFeatureForElectronMain } from "@k8slens/application-for-electron-main";
import { registerFeature } from "@k8slens/feature-core";
import { createContainer } from "@ogre-tools/injectable";
const di = createContainer("some-container");
registerFeature(di, applicationFeature, applicationFeatureForElectronMain);
const startApplication = di.inject(startApplicationInjectionToken);
startApplication();
```
# Extendability
### Timeslots
#### `beforeAnythingInjectionToken`
Runnables registered here will be called before anything else. **Special requirement** here is that everything here needs to be synchronous.
#### `beforeElectronIsReadyInjectionToken`
Runnables registered here will be called right after runnables in `beforeAnythingInjectionToken` but still before we are sure that Electron application is ready (`electron.app.whenReady()`). **Special requirement** here is that everything here needs to be synchronous.