0.1.17 β’ Published 3 years ago
sentineler v0.1.17
π 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
ounpm install sentineler
yarn add sentineler
- Import 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 install
yarn
- 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 - riquessan@gmail.com
Project Link: https://github.com/OuthBack/sentineler