13 lines
371 B
Markdown
13 lines
371 B
Markdown
# 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")
|
|
``` |