import Named from '@stamp/named';
const MyNamedStamp = MyRegularStamp.compose(Named).setName('MyNamedStamp');
Or if you don't want to import the stamp you can import only the method:
import {setName} from '@stamp/named';
const MyNamedStamp = MyRegularStamp.compose(setName('MyNamedStamp'));
Then stamp receives a different name instead of the default "Stamp":
console.log(MyNamedStamp.name); // 'MyNamedStamp'
Derived stamps behaviour:
// All derived stamps will also be named 'MyNamedStamp' until changed:
let Stamp2 = compose(..., MyNamedStamp, ...);
console.log(Stamp2.name); // WARNING! Still 'MyNamedStamp' !!!
// Overwriting the name
Stamp2 = Stamp2.setName('Stamp2');
console.log(Stamp2.name); // 'Stamp2' :)