I need to know , If there is a way , I can make some mutable attributes of a type sharable.
In easier words :
public type Post = {
var pid : Nat;
uid : Nat;
xid : Nat;
ppid : Nat;
var video : Nat;
...................
};
In above type , I made two attributes mutable by adding var , so that i can change them inside a function body (Got this solution from a forum topic) , but when i am passing this Post value as a prop or trying to return it in the function say:
public query func get(xId : Nat) : async [Types.Post]{
..................
return [];
};
I am getting error as :
** shared function has non-shared return type**
Is there any other way , to make some properties of type Post mutable , what am i missing?
:::::::::::::
Also can we declare a triemap as Stable var or not ?