File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
packages/plexus-core/src/collection Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ A piece of data belonging to a collection
1616 * [ .patch(value)] ( #CollectionData+patch ) ⇒ <code >this</code >
1717 * [ .delete()] ( #CollectionData+delete ) ⇒ <code >this</code >
1818 * [ .clean()] ( #CollectionData+clean ) ⇒ <code >this</code >
19+ * [ .decay(time)] ( #CollectionData+decay ) ⇒ <code >this</code >
1920
2021<a name = " CollectionData+id" ></a >
2122
@@ -71,3 +72,14 @@ A piece of data belonging to a collection
7172<p >Clean this data instance (remove all watchers & ; remove the state from the instance)</p >
7273
7374** Returns** : <code >this</code > <p >The data instance</p >
75+ <a name = " CollectionData+decay" ></a >
76+
77+ ### .decay(time) ⇒ <code >this</code >
78+ <p >Decay this data instance after a certain amount of time</p >
79+
80+ ** Returns** : <code >this</code > <p >The data instance</p >
81+
82+ | Param | Type | Description |
83+ | --- | --- | --- |
84+ | time | <code >boolean</code > \| <code >string</code > | <p >The time to decay in ms</p > |
85+
Original file line number Diff line number Diff line change @@ -305,7 +305,10 @@ export class CollectionData<
305305 )
306306 }
307307 this . collection ( ) . lastUpdatedKey = this . key
308-
308+ const decayRate = this . collection ( ) . config . decay
309+ if ( decayRate ) {
310+ this . decay ( decayRate )
311+ }
309312 return this
310313 }
311314 /**
You can’t perform that action at this time.
0 commit comments