Translation of flux js