GithubHelp home page GithubHelp logo

Comments (8)

pasaran avatar pasaran commented on August 15, 2024

А если сделать result: state.items то что получится?

On Fri, Dec 19, 2014 at 11:33 PM, chestozo [email protected] wrote:

Вот для такой ручки:

de.object({
one: de.object(
{ items: { item: [ 'one', 'two' ] } },
{ state: { 'items': '.items.item' } }
),

two: de.object(
    { items: { item: [ 'three', 'four' ] } },
    { state: { 'items': '.items.item' } }
)

}, {
result: 'state.items'
})

Результатом будет:

[
"one",
"two",
"three",
"four"
]

Это баг или фича?

Мне кажется, это баг.
Один из state.items-ов должен был в итоге затереть другой state.items.

/cc @pasaran https://github.com/pasaran @edoroshenko
https://github.com/edoroshenko


Reply to this email directly or view it on GitHub
#105.

from descript.

chestozo avatar chestozo commented on August 15, 2024

Так у меня так и есть result: 'state.items'...

from descript.

pasaran avatar pasaran commented on August 15, 2024

В смысле result: 'state'

On Monday, December 22, 2014, chestozo [email protected] wrote:

Так у меня так и есть result: 'state.items'...


Reply to this email directly or view it on GitHub
#105 (comment).

from descript.

chestozo avatar chestozo commented on August 15, 2024

Будет так:

{
    "items": [
        "one",
        "two",
        "three",
        "four"
    ]
}

from descript.

edoroshenko avatar edoroshenko commented on August 15, 2024

там используется merge, он так работает. Баг это, или фича - вопрос философский. Но переделывать это место я бы не стал, лучше разрулить этот редкий кейс кастомной функцией. Это не то место, где можно с лёгкостью ломать совместимость

from descript.

chestozo avatar chestozo commented on August 15, 2024

А зачем там merge? Вы этим где-то пользуетесь осознанно?
Я это уже разрулил, да, просто поведение было неожиданное.

from descript.

pasaran avatar pasaran commented on August 15, 2024

Хмм. Я ничего про merge не помню, если честно )

from descript.

edoroshenko avatar edoroshenko commented on August 15, 2024

https://github.com/pasaran/descript/blob/master/lib/de.block.js#L337

from descript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.