You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-23Lines changed: 0 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,29 +164,6 @@ fun greet() {
164
164
}
165
165
```
166
166
167
-
168
-
#### Script Syntax: Classic and Modern
169
-
170
-
Backbone supports two ways to write scripts:
171
-
172
-
-**Modern DSL (Recommended):** The new `lifecycle { ... }` syntax is concise, declarative, and covers most use cases for event handling, lifecycle hooks, and inter-script communication. All examples in this README use the new DSL.
173
-
-**Classic API (Still Supported):** The old style, where you inherit from `ManagedLifecycle` and override `onLoad`/`onUnload`, is still fully supported. This approach is more flexible and powerful for advanced users, as it allows you to write imperative code and manage the lifecycle yourself. You can mix and match both styles as needed.
174
-
175
-
Example of the classic style:
176
-
177
-
```kotlin
178
-
classMyScript : ManagedLifecycle() {
179
-
overridefunonLoad() {
180
-
// Custom initialization logic
181
-
}
182
-
overridefunonUnload() {
183
-
// Cleanup logic
184
-
}
185
-
}
186
-
```
187
-
188
-
For most scripts, the new DSL is recommended for its simplicity, but the classic approach remains available for complex or non-declarative scenarios.
189
-
190
167
### Storage and Configuration
191
168
192
169
Backbone provides a simple and powerful way to manage your plugin's data and configuration through `ResourcePool`s. This system allows you to easily handle databases and configuration files in a structured manner.
* This is typically the name of the property it's delegated to.
33
+
* The unique identifier for this sustained state. This is assigned counting up from 0 for each `ManagedLifecycle` instance, based on the order of declaration.
35
34
*
36
35
* @since 1.0.0
37
36
*/
38
-
var id:String?=null
39
-
private set
37
+
var id:Int?=null
38
+
internal set
40
39
41
40
/**
42
41
* The default value of the state.
@@ -53,7 +52,7 @@ class LifecycleSustainedState<T>(private var value: T) : ReadWriteProperty<Manag
53
52
* @return The current value of the state.
54
53
* @since 1.0.0
55
54
*/
56
-
overridefungetValue(thisRef:ManagedLifecycle, property:KProperty<*>): T {
55
+
overridefungetValue(thisRef:Nothing?, property:KProperty<*>): T {
57
56
return value
58
57
}
59
58
@@ -65,28 +64,10 @@ class LifecycleSustainedState<T>(private var value: T) : ReadWriteProperty<Manag
0 commit comments