Skip to content

Commit 63d10e9

Browse files
committed
update README.md
1 parent afed0be commit 63d10e9

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,43 @@
22

33
> Check annotated functions arguments. If they don't change - return last result.
44
> Functions could be logged.
5+
> Support extra custom action on function processing
56
67
import compiler plugin:
78
```kotlin
89
dependencies {
9-
implementation("io.github.stslex:compiler-plugin:0.0.1")
10-
kotlinCompilerPluginClasspath("io.github.stslex:compiler-plugin:0.0.1")
10+
implementation("io.github.stslex:compiler-plugin:$version")
11+
kotlinCompilerPluginClasspath("io.github.stslex:compiler-plugin:$version")
1112
}
1213
```
1314

14-
in code:
15+
in code:
16+
1517
```kotlin
18+
1619
import io.github.stslex.compiler_plugin.DistinctUntilChangeFun
1720

18-
@DistinctUntilChangeFun
19-
fun setUserName(username: String){
20-
// function logic
21+
@DistinctUntilChangeFun(
22+
logging = true,
23+
singletonAllow = false,
24+
name = "set_user_second_name",
25+
action = TestLogger::class
26+
)
27+
fun setUserName(username: String) {
28+
// function logic
2129
}
2230
```
31+
32+
for custom actions:
33+
34+
```kotlin
35+
class TestLogger : Action {
36+
37+
override fun invoke(
38+
name: String,
39+
isProcess: Boolean
40+
) {
41+
println("test action $name procession: $isProcess")
42+
}
43+
}
44+
```

0 commit comments

Comments
 (0)