sentineler
v0.1.17
Published
The package is a "sentinel" that trigger a function when is visible.
Maintainers
Readme
📖 About the project
The package is a "sentinel" that trigger a function when is visible.
🔋 Built with:
:scroll: Getting Started
To run the project it is just:
:warning: Requirements
- npm
npm install npm@latest -g
:gear: Installation
Install the package
npm install sentinelerou
yarn add sentinelerImport the package
import Sentineler from "sentineler";Call the compoenent and give the callback
<Sentinel callback={() => { console.log("test"); }} />Example:
import Sentineler from "sentineler"; const App = () => { return ( <Sentinel callback={() => { console.log("test"); }} /> ); }; export default App;
:bone: Props
| Prop | Type | Default | Description |
| --------------------- | -------- | ------- | ------------------------------------------------------- |
| callback (required) | Function | – | Callback function to run when the Sentineler is visible |
🖥️ Site Preview
I made this infinite scroll using this component.
See the Site Preview: https://taq-challenge.vercel.app
:dart: Test
To contribute to the project you just need:
- Clone the repository
git clone https://github.com/OuthBack/sentineler - Install the packages
ounpm installyarn - For now you can create a link, but soon I will create a react application
yarn link - In another project that you are using react
yarn link "sentineler" - Now it is just follow the example
:pencil: Licence
Distributed under the MIT License. See LICENSE for more information.
:telephone_receiver: Contact
Henrique Figueiredo - [email protected]
Project Link: https://github.com/OuthBack/sentineler
