Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples/Tests for 0.2.0 #5

Closed
markjfisher opened this issue May 3, 2019 · 2 comments
Closed

Examples/Tests for 0.2.0 #5

markjfisher opened this issue May 3, 2019 · 2 comments

Comments

@markjfisher
Copy link

I've just started using Kunafa, and struggling to find some concrete examples of usage.

The closest is the information in https://medium.com/the-kotlin-chronicle/kunafa-easy-to-use-high-level-framework-in-kotlin-for-front-end-web-development-ee5237aea5b but it doesn't link Component classes to a main, so I'm struggling to put them together. I'm sure it's obvious but I'm just missing it

I'd just like something fairly simple, so far I've created a simple Component class, as this:

class AppView: Component() {
    override fun View?.getView(): View {
        return horizontalLayout {
            textView {
                text = "Some text"
            }
        }
    }
}

but how do I use it?
So far this is all I've managed:

fun main(args: Array<String>) {
    page {
        AppView().addToParent(this)
    }
}

which feels less than optimal.

I'd also ask, where are the tests? This is a large-ish code base for what it does but I don't see any tests anywhere. They were the first things I looked for in trying to work out how to get this going.

@markjfisher markjfisher changed the title Examples for 0.2.0 Examples/Tests for 0.2.0 May 3, 2019
@Kabbura
Copy link
Member

Kabbura commented May 4, 2019

Hi
Here is a complete example for how to build an app. Kunafa Todo App.
To answer your question, call mount()

fun main(args: Array<String>) {
    page {
        mount(AppView())
    }
}

And yeah, the tests are not complete yet. We are working on completing the tests suite and publishing it.

@markjfisher
Copy link
Author

Thank you so much for this! And the full working example.
This will really get me off the ground now. Cheers, I'll close this.
Hope to see those tests soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants