Retrieving AlpineJS data in a global function