Giter Site home page Giter Site logo

Repeat every X times about only HOT 3 CLOSED

zunjae avatar zunjae commented on May 20, 2024 2
Repeat every X times

from only.

Comments (3)

skydoves avatar skydoves commented on May 20, 2024 1

@zunjae
Hi, I thought about your multiple variants feature related to repeating a task every X times.
I implemented onLastDo, onBeforeDone features for pre and post-processing on version 1.0.2.

So I think here is the new solution to resolve Variant 1)

only("rating", times = 10) {
  onLastDo { // this will be executed after 10 times
    if (showPopupAndGetResult() == false) { // if user did not rate
      Only.clearOnly(name) // clears rating Only data. This makes repeat again from 0 times onDo task.
    }
  }
}

Variant 3) is quite similar.

only("repeat", times = 10) {
  onLastDo {
    Only.clearOnly(name)
    // doSomething
  }
}

And I implemented marking feature on version 1.0.3.
I think this is a solution that implementing remind them every 10 app startups 2 times using marking.

only("whatsNew", times = 20) {
  onDo {
    val marking = Only.getMarking(name)!!.toInt()
    Only.mark(name, marking + 1)
    if (marking % 10 == 0) {
      showPopup()
    }
  }
  version("1.0.0.0")
  mark(1)
}

But I think it is not too clear and simple for resolving Variant 2) yet.
It seems better implementing other feature which related to repeating a task every X times.
Anyway, thank you for your issue! :)

from only.

zunjae avatar zunjae commented on May 20, 2024 1

Looks good, thank you!

from only.

skydoves avatar skydoves commented on May 20, 2024

@zunjae
Thank you for your issue!
I will consider implementing those features next version. :)

from only.

Related Issues (3)

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.