You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The piling configuration is a subset of the entire state. The idea is that one can export and save just the configuration for later reuse with different datasets.
Similar to exporting the entire state we would have to get the current state of the library. In addition, we need to define which property is considered part of the piling configuration and only keep those properties. Also for certain properties, we need to provide an efficient way of serializing functional parameters like easing.
On export, the easiest way to do the serialization is to check if the functional property is an internal property (e.g., state.easing === cubeInOut) and if so only return a string referencing this function (e.g., easing: 'cubeInOut'). Otherwise, we have to stringify the function (e.g., state.easing.toString().
On import, for functional properties, we have to check if the value represents some internal functions or if it's a stringified custom function. E.g.:
// SomewherevareasingMap=newMap();easingMap.set('cubeInOut',cubeInOut);// In the import functionset({
...import,easing: easingMap.has(import.easing)
? easingMap(import.easing)
: eval(`(${import.easing})`)});
The text was updated successfully, but these errors were encountered:
The piling configuration is a subset of the entire state. The idea is that one can export and save just the configuration for later reuse with different datasets.
Similar to exporting the entire state we would have to get the current state of the library. In addition, we need to define which property is considered part of the piling configuration and only keep those properties. Also for certain properties, we need to provide an efficient way of serializing functional parameters like
easing
.On export, the easiest way to do the serialization is to check if the functional property is an internal property (e.g.,
state.easing === cubeInOut
) and if so only return a string referencing this function (e.g.,easing: 'cubeInOut'
). Otherwise, we have to stringify the function (e.g.,state.easing.toString()
.On import, for functional properties, we have to check if the value represents some internal functions or if it's a stringified custom function. E.g.:
The text was updated successfully, but these errors were encountered: