Methods
Get current slotItemMap from a Swapy instance.
Each Swapy instance keeps track of the current relationship between slots and items. You can query that using swapy.slotItemMap()
method.
const currentSlotItemMap = swapy.slotItemMap()
console.log(currentSlotItemMap.asObject)
// {
// 'foo': 'a',
// 'bar': 'b',
// 'baz': 'c'
// }
console.log(currentSlotItemMap.asArray)
// [
// { slot: 'foo', item: 'a' },
// { slot: 'bar', item: 'b' },
// { slot: 'baz', item: 'c' }
// ]
console.log(currentSlotItemMap.asMap)
// Map(3) {
// 'foo' => 'a',
// 'bar' => 'b',
// 'baz' => 'c'
// }