Skip to content

Factory method to create delay implementation with bound timer methods #39

@novemberborn

Description

@novemberborn

It'd be useful if I could do the following:

import { factory } from 'delay'

const delay = factory({ setTimeout, clearTimeout })

Since this binds the implementation to the timer methods I've provided, I can then safely stub the timers using say lolex and still use the delay interface.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions