Add emitter so I can now send events to the RN core
This commit is contained in:
parent
4e4a92c2a3
commit
7177b9e927
7 changed files with 111 additions and 14 deletions
21
ios/Native/Application/Shared/SharedState.swift
Normal file
21
ios/Native/Application/Shared/SharedState.swift
Normal file
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// SharedState.swift
|
||||
// RNPlayground
|
||||
//
|
||||
// Created by Artur Gurgul on 02/08/2025.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Combine
|
||||
import React
|
||||
import React_RCTAppDelegate
|
||||
import ReactAppDependencyProvider
|
||||
|
||||
final class SharedState: ObservableObject {
|
||||
var reactNativeFactory: RCTReactNativeFactory?
|
||||
private let emitter = EventEmitter.sharedInstance
|
||||
|
||||
func send(message: String) {
|
||||
emitter.send(message: message)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue