1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Update README

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2023-03-02 15:05:42 +02:00
parent 86fe5e6d14
commit 046d72b99f
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
2 changed files with 60 additions and 7 deletions

View File

@ -2,17 +2,38 @@
This package contains stuff related to creating Lens-applications. This package contains stuff related to creating Lens-applications.
In the beginning it will contain just the injection tokens used to configure the application. # Usage
## Install
```bash ```bash
$ npm install @k8slens/application $ npm install @k8slens/application-for-electron-main
```
```typescript
import { applicationFeature, startApplicationInjectionToken } from "@k8slens/application";
import { registerFeature } from "@k8slens/feature-core";
import { createContainer } from "@ogre-tools/injectable";
const di = createContainer("some-container");
registerFeature(di, applicationFeature);
const startApplication = di.inject(startApplicationInjectionToken);
startApplication();
``` ```
## Usage ## Features
As of now, this package doesn't do anything alone. It just provides you way to register implementation for contract. #### Start application
`startApplicationInjectionToken`
Future ambition is that all stuff related to how applications are built will be relocated here. Starts the application and calls timeslots in specified order. Check for timeslots for more info.
## Extendability
#### Timeslots
1. `beforeApplicationIsLoadingInjectionToken`
2. `onLoadOfApplicationInjectionToken`
3. `afterApplicationIsLoadedInjectionToken`

View File

@ -1,3 +1,35 @@
# @k8slens/application-for-electron-main # @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.