[core][iOS] Add StaticFunction and StaticAsyncFunction to Class in modules API#38754
[core][iOS] Add StaticFunction and StaticAsyncFunction to Class in modules API#38754
Conversation
|
Subscribed to pull request
Generated by CodeMention |
|
The Pull Request introduced fingerprint changes against the base commit: 6be2724 Fingerprint diff[
{
"op": "changed",
"beforeSource": {
"type": "dir",
"filePath": "../../packages/expo-modules-core",
"reasons": [
"expoAutolinkingIos",
"expoAutolinkingAndroid"
],
"hash": "49fa089379ae54b1cbb9dfff3960bead61efbd17"
},
"afterSource": {
"type": "dir",
"filePath": "../../packages/expo-modules-core",
"reasons": [
"expoAutolinkingIos",
"expoAutolinkingAndroid"
],
"hash": "81925512cd02102f741e642d53957db2fb08da0b"
}
}
]Generated by PR labeler 🤖 |
Kudo
left a comment
There was a problem hiding this comment.
quick question: what is the static function in this context? is that a function binding to the shared object instance and not binding to object's prototype?
It's function bound to the object's constructor, making it the 'standard' javascript static method on a class. For example, we could have a shared object called |
cool, thanks for this clarification. wdyt to rename it as |
5826f9a to
6fa1404
Compare
@jakex7 did you consider this option? when i first seen this i was confused what the "static" until you explained it. i guess |
Sorry for not responding earlier. Yes, I’ve considered that, but I’m not sure if it’s the best approach. It can only be used within a |
wait. i was thinking that Property is binded to instance, not class itself . from the example, it looks like object = new expo.modules.TestModule.Counter(0);
object.currentValuedoes it also work like |
ac6face to
e8c474b
Compare
6b97739 to
92fd6a5
Compare
Why
It should be possible to create a static functions on SharedObjects
How
Add
StaticFunctionandStaticAsyncFunctionin DSL and decorate the class constructor with them.Test Plan
Checklist
changelog.mdentry and rebuilt the package sources according to this short guidenpx expo prebuild& EAS Build (eg: updated a module plugin).