Line data Source code
1 : import { uniq } from 'es-toolkit'
2 : import { defineStore } from 'pinia'
3 :
4 : /** Which sets of missing node types the custom deployment dialog already opened for on its own on this page. */
5 2355 : export const useCustomDeploymentOfferStore = defineStore(
6 : 'customDeploymentOffer',
7 : () => {
8 0 : const offeredFor = new Set<string>()
9 :
10 0 : function offerOnce(nodeTypeNames: readonly string[]): boolean {
11 0 : const key = uniq(nodeTypeNames).sort().join('\n')
12 0 : if (offeredFor.has(key)) return false
13 0 : offeredFor.add(key)
14 0 : return true
15 : }
16 :
17 0 : return { offerOnce }
18 : }
19 : )
|