Mod Creation/Mod Context API Reference: Difference between revisions

Line 858: Line 858:
});</nowiki>
});</nowiki>


==== PropertyPatch.replace(getter?: () => any, setter?: (o: undefined, value: any) => void): void ====
==== PropertyPatch.replace(getter?: () => any, setter?: (value: any) => void): void ====


Alias for calling <code>get</code> and <code>set</code> at the same time.
Alias for calling <code>get</code> and <code>set</code> at the same time.
Line 866: Line 866:
<code>getter: () => any</code> The getter function to be executed.
<code>getter: () => any</code> The getter function to be executed.


<code>setter: (o: undefined, value: any) => any</code> The getter function to be executed, with the <code>value</code> argument containing the value being set. The <code>o</code> argument is currently a placeholder and is unused.
<code>setter: (o: undefined, value: any) => any</code> The getter function to be executed, with the <code>value</code> argument containing the value being set.


'''Example'''
'''Example'''
91

edits