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
28
ios/Native/Application/Shared/Emitter/EventEmitter.swift
Normal file
28
ios/Native/Application/Shared/Emitter/EventEmitter.swift
Normal file
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// EventEmitter.swift
|
||||
// RNPlayground
|
||||
//
|
||||
// Created by Artur Gurgul on 02/08/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class EventEmitter {
|
||||
static let sharedInstance = EventEmitter()
|
||||
|
||||
private var eventEmitter: Emitter?
|
||||
|
||||
private init() {}
|
||||
|
||||
func register(eventEmitter: Emitter) {
|
||||
self.eventEmitter = eventEmitter
|
||||
}
|
||||
|
||||
func send(message: String) {
|
||||
eventEmitter?.send(message: message)
|
||||
}
|
||||
|
||||
var isReady: Bool {
|
||||
return eventEmitter != nil
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue