tracking the rate of consumption for each item INSIDE the function that is stored in var.items
I guess the best work around would be to save the data tables separately from the function (Basically move away from a class mentality).
Don't think I understand what exactly is "class mentality" in lua, but presumably "inside the function" means its locals, and then I think another workaround might be passing the global state-table to some class-init-func and storing everything there instead of its locals.
Then presumably when function gets cleaned-up, you'll still have that pseudo-locals table to init the thing with after load.
prefix that you add the signals currently do not get removed when using the signal as a key in the _api. tables.
Yeah, but these internal signal IDs are not supposed to be used with factorio APIs anyway, as it doesn't have string IDs for signals, uses tables like {type='item', name='se-filtered-miniloader'}
as SignalID objects.
And of course it's not really the purpose of these combinators to be a gateway to factorio modding API, despite plenty of people apparently using them that way :)
There can also be even weirder prefixes, like when red/green inputs are mismatched, you can get e.g. red/se-filtered-miniloader
+ green/se-filtered-miniloader
, which you probably wouldn't want to be stripped, as whole point of them is to disambiguate two different values sharing same factorio SignalID "name".