- backend: add summoner spells - backend: add build variants - backend: builds are now storing full tree with runes (keystones) - backend: build trees are split on starter items and merged on runes - frontend: computing core tree now - frontend: variant selectors
20 lines
392 B
TypeScript
20 lines
392 B
TypeScript
/**
|
|
* Composable for managing build data
|
|
*/
|
|
import { deepClone } from '~/utils/helpers'
|
|
|
|
export const useBuilds = (buildsProp: Ref<Builds>) => {
|
|
const builds = ref<Builds>(deepClone(buildsProp.value))
|
|
|
|
// Watch for changes and rebuild
|
|
watch(
|
|
() => buildsProp.value,
|
|
newBuilds => {
|
|
builds.value = deepClone(newBuilds)
|
|
},
|
|
{ deep: true }
|
|
)
|
|
|
|
return { builds }
|
|
}
|