initial commit
This commit is contained in:
13
readme.md
Normal file
13
readme.md
Normal 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")
|
||||
```
|
||||
Reference in New Issue
Block a user