Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 967 Bytes

README.md

File metadata and controls

35 lines (24 loc) · 967 Bytes

Praefix

A small utility to get the prefixed vendor function if needed.

GitHub GitHub issues GitHub pull requests

Sources

If you wan to get more information about vendor prefixes, look up MDN Web Docs.

Install

npm install @jstiller/praefix

Usage

import praefix from "praefix"

const requestAnimationFrameFunction = praefix("requestAnimationFrame", window);

it's equal to the following

const requestAnimationFrameFunction = window.requestAnimationFrame
    || window.mozRequestAnimationFrame
    || window.webkitRequestAnimationFrame
    || window.oRequestAnimationFrame
    || window.msRequestAnimationFrame;