stampit API

@stamp/named (DEPRECATED)

This stamp (aka behaviour) is built into the stampit since [email protected] and @stamp/[email protected].

@stamp/named (DEPRECATED)

Changes the property using the new ES6 feature.
Supported platforms: node>=4, iOS>=10, Edge, FF, Chrome, Safari
If used in a non-supported environment (node <v4, or IE any version) then nothing will throw. But the will always be "Stamp".


Default behaviour (without this stamp):
const MyRegularStamp = compose(...);
console.log(; // 'Stamp'
New behaviour:
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'
Derived stamps behaviour:
// All derived stamps will also be named 'MyNamedStamp' until changed:
let Stamp2 = compose(..., MyNamedStamp, ...);
console.log(; // WARNING! Still 'MyNamedStamp' !!!
// Overwriting the name
Stamp2 = Stamp2.setName('Stamp2');
console.log(; // 'Stamp2' :)