Giter Club home page Giter Club logo

Comments (4)

robisim74 avatar robisim74 commented on July 17, 2024

Extract & Inline tools use a parser built specifically for this library. Should we extend it into a compiler to cover cases such as null coalescing?

Rather, I think it's simpler and more correct to initialize the signal, instead of adding null coalescing wherever it's used:

const number = useSignal<number>(0)
const p = usePlural()

return <div>{p(number.value, 'app.someKey')}</div>

from qwik-speak.

tzdesign avatar tzdesign commented on July 17, 2024

@robisim74 If your backend delivers something which can be null, you have to add a useComputed only for duplicating the same value. If it's to complex, we can work with it, but I was very confused seeing this files.

from qwik-speak.

robisim74 avatar robisim74 commented on July 17, 2024

t & p closure functions are only placeholders that will be replaced with simple texts in production. They expect as first param a value or an identifier for now.

You can manage null values also in jsx (in my opinion more appropriate):

{number.value && <div>{p(number.value, 'app.someKey')}</div>}

Note. You can't extend a library to cover every single case that occurs (because otherwise it would grow indefinitely). To implement a request you need to:

  • that the case is probable to occur
  • that there are no simple alternative solutions
  • that the implementation covers all analogous cases, in our example null coalescing, logical or, ternary operator and so on

from qwik-speak.

tzdesign avatar tzdesign commented on July 17, 2024

Maybe I still not understand how the whole workflow is and I have to read it first.

from qwik-speak.

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.