shadowtask
v0.1.3
Published
shadowtask
Readme
shadowtask
shadowtask
Installation
npm install shadowtaskUsage
import * as shadowtask from 'shadowtask';
const listenerSubscription = useRef<null | EventSubscription>(null);
useEffect(() => {
shadowtask.registerRecurringTask('recurringOne', 1000);
shadowtask.registerRandomRecurringTask('recurringOne', 1000, 2000);
listenerSubscription.current = shadowtask.onRecurringTaskUpdate(
'recurringOne',
(pair) => console.log(`New task: ${pair.taskId}`)
);
return () => {
shadowtask.unregisterRecurringTask('recurringOne');
shadowtask.unregisterRecurringTask('recurringTwo');
listenerSubscription.current?.remove();
listenerSubscription.current = null;
}
}, []);Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
