initial commit

This commit is contained in:
Robin Chappatte
2024-06-01 16:32:44 +02:00
commit 127ae6abd9
4 changed files with 201 additions and 0 deletions

13
readme.md Normal file
View File

@@ -0,0 +1,13 @@
# Function injection
Provide a way to inject the first(s: up to nine) arguments in a function.
Example:
```typescript
function myFunc(p1: string, p2: string, p3: string) {
console.log(p1, p2, p3)
}
const injected = inject(myFunc, "A", "B"); //< `injected` is a function that only take one argument
injected("C"); //< same result as calling `myFunc("A", "B", "C")
```