import { withEffects } from "@funkia/io" ; import { Behavior , fromFunction } from "@funkia/hareactive" ; export function itemBehavior < A = any > ( key ) { return fromFunction ( ( ) => JSON . parse ( localStorage . getItem ( key ) ! ) ) ; } export const setItemIO = withEffects ( ( key , value ) => { localStorage . setItem ( key , JSON . stringify ( value ) ) ; } ) ; export const removeItemIO = withEffects ( ( key ) => { localStorage . removeItem ( key ) ; } ) ;