I am trying to export a file that contains an object with a unique reference each time it is imported. Currently, when two files import this single export, they share the same reference and changes made in one file reflect in the other as well. I attempted using an IIFE, but it did not resolve the issue.
export.js
export const pagination =
(function ()
{
let page_lengths =
live
? [
5,
10,
15,
20,
25
]
: [
1,
2,
3,
4,
5
]
return {
page:
1,
page_length:
page_lengths[0],
page_lengths,
total:
0,
}
})()
import.js
import {
pagination,
} from "export.js"