@atomico/hooks
Advanced tools
Comparing version 3.3.0 to 3.3.1
{ | ||
"name": "@atomico/hooks", | ||
"description": "Series of utilities in hooks format to extend the operation of Atomico", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "exports": { |
@@ -19,2 +19,3 @@ import { useHost, useState, useEffect, useEvent } from "atomico"; | ||
/** | ||
* Associate a subscriber and return a callback to describe | ||
* @param {(value:any)=>void} callback | ||
@@ -24,3 +25,7 @@ */ | ||
// Notify subs | ||
/** | ||
* Notify subs and gives them the new state | ||
* @param {*} state | ||
* @returns {void} | ||
*/ | ||
host.sync = (state) => [...subs].forEach((fn) => fn(state)); | ||
@@ -27,0 +32,0 @@ |
@@ -18,2 +18,4 @@ import { useState, useEffect } from "atomico"; | ||
if (!routes) return; | ||
// Returns to the default state to recycle the routes object | ||
setState(DefaultState); | ||
@@ -20,0 +22,0 @@ const reduce = () => { |
18645
582