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

Change scheduler schedule signature #265

Closed
benlesh opened this issue Sep 4, 2015 · 2 comments · Fixed by #267
Closed

Change scheduler schedule signature #265

benlesh opened this issue Sep 4, 2015 · 2 comments · Fixed by #267
Assignees
Labels
help wanted Issues we wouldn't mind assistance with.
Milestone

Comments

@benlesh
Copy link
Member

benlesh commented Sep 4, 2015

Funny enough, I feel like this is the first way I did scheduling, but @trxcllnt is resurrecting it...

Instead of:

schedule(delay: number, state:any, work:(state?: any) => Subscription | void) : Subscription

it should be:

schedule(work:(state?: any) => Subscription | void, delay: number = 0, state?: any) : Subscription

This actually brings it sort of inline with methods like setTimeout to a degree.

@benlesh benlesh added the help wanted Issues we wouldn't mind assistance with. label Sep 4, 2015
@benlesh benlesh added this to the Alpha release milestone Sep 4, 2015
@benlesh benlesh self-assigned this Sep 4, 2015
@headinthebox
Copy link

Any reason you have the state parameter?

@benlesh
Copy link
Member Author

benlesh commented Sep 4, 2015

@headinthebox it's to pass data/parameters to the work function, mostly.

someScheduler.schedule(dispatch, 100, { name: 'world' });

function dispatch(state) {
  console.log('hello ' + state.name);
}

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Issues we wouldn't mind assistance with.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants