I'm using a nodejs package called casual Which basically lets one generate random data
Im defining this method for generating imgs
casual.define('portrait', () => ({
uri: `https://source.unsplash.com/collection/9948714?sig=${casual.integer(1, 100)}`
}));
From this, I create an array of images like this :
[
{"uri":"https://source.unsplash.com/collection/9948714?sig=37"},
{"uri":"https://source.unsplash.com/collection/9948714?sig=32"},
{"uri":"https://source.unsplash.com/collection/9948714?sig=91"},
]
I'm supposed to get a different image each time, but the PROBLEM is that I get the same picture 3 times, even with the sig.
What I'm I doing wrong?
[SOLVED]
casual.define('portrait', () => ({
uri: `https://source.unsplash.com/collection/9948714?${casual.integer(1, 100)}`
}));
generating
[
{"uri":"https://source.unsplash.com/collection/9948714?37"},
{"uri":"https://source.unsplash.com/collection/9948714?32"},
{"uri":"https://source.unsplash.com/collection/9948714?91"},
]
just adding a number instead of sig=number worked