Coder Social home page Coder Social logo

Comments (6)

lukewarlow avatar lukewarlow commented on July 23, 2024 1

Ah I've just spotted mine returns a promise but the spec says it is a promise itself.

Thanks for pointing that out. I'll correct this tomorrow and push out an update.

from view-transitions-api-types.

lukewarlow avatar lukewarlow commented on July 23, 2024 1

I'm going to go ahead and close this for now as the types match the specification but feel free to open a new one in future if the spec updates.

from view-transitions-api-types.

lukewarlow avatar lukewarlow commented on July 23, 2024

My type matches the spec here right specifying a promise return?

from view-transitions-api-types.

lukewarlow avatar lukewarlow commented on July 23, 2024

Screenshot_20230910-180704.png

Please correct me if I've misunderstood.

from view-transitions-api-types.

lukewarlow avatar lukewarlow commented on July 23, 2024

Firstly apologies for the delay in getting back to this.

@jantimon sorry can I just double check is there actually an issue with my code. I re-read the spec an it appears it does in fact match my types. UpdateCallback is a callback that returns Promise like my type does.

It also partly matches https://github.com/nuxt/nuxt/blob/ceab38770d5e80929518cfd5c71081756288bb55/packages/nuxt/src/app/plugins/view-transitions.client.ts#L5

Nuxt is also allowing a void return type for the callback which doesn't seem to actually match the spec?

from view-transitions-api-types.

jantimon avatar jantimon commented on July 23, 2024

looks good to me 👍

you are right according to

https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition

and

https://drafts.csswg.org/css-view-transitions/#callbackdef-updatecallback

the return type of updateCallback has to be a promise:

Then, when the promise returned by updateCallback fulfills, the new state of the document is captured and the transition is initiated.

however the current implementation in chrome seems to allow void too

from view-transitions-api-types.

Related Issues (1)

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.