https://github.com/budarin/service-stub
Proxy wrapper for deferring interactions with uninitialized services until readiness.
https://github.com/budarin/service-stub
Last synced: about 1 month ago
JSON representation
Proxy wrapper for deferring interactions with uninitialized services until readiness.
- Host: GitHub
- URL: https://github.com/budarin/service-stub
- Owner: budarin
- License: mit
- Created: 2023-12-10T16:14:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-28T08:37:43.000Z (6 months ago)
- Last Synced: 2025-03-27T21:39:40.587Z (2 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@budarin/service-stub
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# service-stub
Proxy wrapper for deferring interactions with uninitialized services until readiness.
## Install
```bash
yarn add @budarin/service-stub
```## Usage
```ts
import type { CoolService } from '../';import { createServiceStub } from '@budarin/service-stub';
const stub = createServiceStub('cool-service', 'Service not initialized:');
stub.log('Hi World!');
// => 'Service not initialized: cool-service'const stub = createServiceStub('cool-service');
stub.log('Hi World!');
// => 'Попытка обратиться к неинициализированному сервису: cool-service'
```## License
MIT