heroiclabs / nakama-js

JavaScript client for Nakama server written in TypeScript.
https://heroiclabs.com/docs/nakama/client-libraries/javascript/
Apache License 2.0
194 stars 56 forks source link

Updates codegen for Satori support and adds QoL functions for flags #142

Closed tomglenn closed 1 year ago

tomglenn commented 1 year ago

@lugehorsam Pushed an update to add in those separate functions. The base functions (getFlag and getFlagDefault) now return a rejected promise when the network call fails or the flag does not exist. The new functions (getFlagWithFallback and getFlagDefaultWithFallback) will return a flag with the given fallback value when the flag does not exist. For getFlagWithFallback it will still return a rejected promise if the server is unavailable / the session is invalid etc. For getFlagDefaultWithFallback it will return a flag with the given fallback regardless of whether it could reach the Satori server or the flag doesn't exist.