deep-foundation / deep-foundation/deeplinks

`deep.value`

Open
#243 0 comments 0 reactions 1 assignee Claimed by @konard View on GitHub
question
Dominant language
TypeScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Duplicated patterns found:
```js
if (min) deep.update({ link_id: min?.id }, { value: t }, { table: 'numbers' });
else deep.insert({ type_id: Min, from_id: link.id, to_id: link.id, number: { data: { value: t } } });
```
```js
if (max) deep.update({ link_id: max?.id }, { value: t }, { table: 'numbers' });
else deep.insert({ type_id: Max, from_id: link.id, to_id: link.id, number: { data: { value: t } } });
```

By link id
```js
deep.value(linkId, value); // set value by linkId
deep.value(linkId) // get value by linkId
```

By link object
```js
const link = { id: ... }; // existing link
const link = { type_id: ... }; // link pattern/template to be inserted

deep.value(link, value); // set value by by link object (allows make update or insert)
deep.value(link) // get value by link object
```

Or this should be a part of link's IUD?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.