Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ class HybridViewModelListProperty(private val listProperty: ViewModelListPropert
return Promise.async { getInstanceAt(index) }
}

override fun addInstanceAsync(instance: HybridViewModelInstanceSpec): Promise<Unit> {
return Promise.async { addInstance(instance) }
}

override fun addInstanceAtAsync(instance: HybridViewModelInstanceSpec, index: Double): Promise<Unit> {
return Promise.async { addInstanceAt(instance, index) }
}

override fun removeInstanceAsync(instance: HybridViewModelInstanceSpec): Promise<Unit> {
return Promise.async { removeInstance(instance) }
}

override fun removeInstanceAtAsync(index: Double): Promise<Unit> {
return Promise.async { removeInstanceAt(index) }
}

override fun swapAsync(index1: Double, index2: Double): Promise<Unit> {
return Promise.async { swap(index1, index2) }
}

override fun addListener(onChanged: () -> Unit): () -> Unit {
val remover = addListenerInternal { _ -> onChanged() }
ensureValueListenerJob(listProperty.valueFlow.map { })
Expand Down
20 changes: 20 additions & 0 deletions ios/HybridViewModelListProperty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ class HybridViewModelListProperty: HybridViewModelListPropertySpec, ValuedProper
return Promise.async { try self.getInstanceAt(index: index) }
}

func addInstanceAsync(instance: any HybridViewModelInstanceSpec) throws -> Promise<Void> {
return Promise.async { try self.addInstance(instance: instance) }
}

func addInstanceAtAsync(instance: any HybridViewModelInstanceSpec, index: Double) throws -> Promise<Void> {
return Promise.async { let _ = try self.addInstanceAt(instance: instance, index: index) }
}

func removeInstanceAsync(instance: any HybridViewModelInstanceSpec) throws -> Promise<Void> {
return Promise.async { try self.removeInstance(instance: instance) }
}

func removeInstanceAtAsync(index: Double) throws -> Promise<Void> {
return Promise.async { try self.removeInstanceAt(index: index) }
}

func swapAsync(index1: Double, index2: Double) throws -> Promise<Void> {
return Promise.async { let _ = try self.swap(index1: index1, index2: index2) }
}

func addListener(onChanged: @escaping () -> Void) throws -> () -> Void {
helper.addListener({ _ in onChanged() })
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 107 additions & 0 deletions nitrogen/generated/ios/swift/HybridViewModelListPropertySpec_cxx.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading