I thought I could just use obj?.let { MyObj(obj) }...
# announcements
f
I thought I could just use obj?.let { MyObj(obj) }, but I think this is giving me a function like a Supplier rather than the actual object. Thread in Slack Conversation deinspanjer: How about this?
Copy code
class MyObject(var arg: Any?){
        
        companion object{
            fun create(arg : Any?) = arg.let{MyObject(arg)}
        }
    }