Add functionality to TSU to allow hiding clones without losing states.
asaka-wa opened this issue · 3 comments
Is your feature request related to a problem? Please describe.
Often, when using a TSU, you want to have WA hold your data in states but don't always want to have them displayed. Setting show
to false
will tell WA to go ahead and delete the state entirely.
An example might be tracking timed events on specific targets. As you change targets you only want to see the timers relevant to the current target but if you go back to a previous target you want those timers to still exist.
Describe the solution you'd like
state.hide = bool
Or something similar that will stop the state from being rendered in a clone, but won't delete the state from the allstates table.
Describe alternatives you've considered
The usual advice for people asking about this stuff is to have their own table track whatever data they need to maintain, rather than rely on WA to store it for them.
Another solution since Custom Grow functions were added is to handle the hiding there.
It would be very convenient to be able to handle it all in the trigger function though.
In isolation this is a fine request. But I worry that it will only increase the learning curve for an already complex feature, particularly when the problem this would solve is already solved by providing aura_env to the author. It is also not a problem that we have any need of solving in any builtin trigger I can think of.
Therefore, I am of the opinion that this is not worth the added complexity in the trigger implementation. -1 from me.
I think there's no need to add any additional functionality for that. WA doesn't clear the table on removing it from allstates, thus if you keep a reference to the table you can keep on reusing the same table and keep your meta data in that.
E.g. this simple aura shows how this can be done:
!nJr7UTTnW3LcmGwGMalNKU9N9d7eNvp4k7zQ0MS2klArklUkt6skLeNHQN9DhPKLDStQxAa2GtmOoEF)LUZHEHbHeti5m(1HK5Heg(haAMwDdaD4h8djtvAgx3Lg)fMwTiK0ntC3DunRmkqPYYfaOBhMKy45H(Tcjlx7mvgNQ0JuczEi50E(b9gxZVtvzknikFpet)22VpY(9XiqGaZcAmhVIqJZfkPXQS5uDoCaUprifMu3z4OdkCoxlMnJRnoUhScaEKXNwKKeSCbpK82EdgD(fdG7Tpsl002Ou5zz9zghFnft5xZL5eGkXTHKjN2HemHe0zmWScuOKfz0LaZjs6CEfvwsabWPz5PnmzKMBzczuVbdq8kKnQwUt5JvzfZLeNP7fs0uMOWaEHwG)SWWhiMdcDkOUzIzYgVk4xSmcD7G8gZNv5XaEMPO2Okq(K4mQXG0d2zmcCEbedRDDUBVpuJ4o(9bcGNwLsSEO0Z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IYRMaGt49vy5o(tyF0ki7HLBXlrHg55Ab8s9)OGYW5HHHM3u87XUIRH9v1k7bE1WBCNUb5SqRQgWjDwPkUiUVD5blWngzSVVpKRmU)V92G6HjVATXlTe8xqkNizztGZUhbpW6H8h63RMYlVpLO8DBX412LDLYfZsrV(jn7W9JV2MnROBgu8unB7zNzN7Rdd1DoJZEh9wm9z9DM(F8(a3t3bznDZ1fRsU)3(Ziy9tyCRqdmPpwNMaB89PtPqewoRlv)Pl6FqZthqqcQQ8nc01wNQGJQ3DNlNzfYBRIZhvLkyfy9pZsfoN(9lOUtbtRVAbg0lSJftDcuWyCyrb)EVhtrPzlsDBHU3BLEJBLl3VkbUC7O34)1KFUF3lgUeDJOyT9GQweg2(vlGwUvBO82HJ7)Nd9d6myh7Jcaqkx7hvYgpUg0OJBJwA4)8d
Note that for simplicity I put the init code into the trigger, but that doesn't matter. What matters is that the data in there stays around.