https://github.com/tripolskypetr/di-factory
The generic repository pattern implementation for NodeJS, aka BaseCRUD
https://github.com/tripolskypetr/di-factory
Last synced: 4 months ago
JSON representation
The generic repository pattern implementation for NodeJS, aka BaseCRUD
- Host: GitHub
- URL: https://github.com/tripolskypetr/di-factory
- Owner: tripolskypetr
- Created: 2024-11-21T10:19:18.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-12-10T15:07:27.000Z (10 months ago)
- Last Synced: 2025-01-31T07:11:52.450Z (8 months ago)
- Language: TypeScript
- Homepage: https://github.com/react-declarative/react-declarative
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# di-factory
> The generic repository pattern implementation for NodeJS, aka `BaseCRUD`
## Usage
```tsx
import { factory } from 'di-factory';const Basecrud = factory(
class {
constructor(public name: string, public collectionId: string) {}
getName = () => this.name;getCollectionId = () => this.collectionId;
}
);class TestCrud extends Basecrud("test-crud", "collection-uuid") {}
const testCrud = new TestCrud();
console.log(testCrud.getName()); // test-crud
```## See also
If you looking for integrated DI container for basecrud services instantiation, take a look on [di-kit npm package](https://www.npmjs.com/package/di-kit)