From 49ef6cd1e8cbf9c6bf199b7ff15a6424912712ce Mon Sep 17 00:00:00 2001 From: Rajaniraiyn R Date: Thu, 26 Dec 2024 02:22:19 +0530 Subject: [PATCH] fix: rename library from Alien React Signals to React Alien Signals and update related documentation --- .github/workflows/docs.yml | 8 +------- README.md | 26 +++++++++++++------------- src/index.ts | 2 +- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b080624..94ec993 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,6 +12,7 @@ permissions: jobs: build: + name: Build and Deploy permissions: contents: write runs-on: ubuntu-20.04 @@ -34,13 +35,6 @@ jobs: with: path: docs - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/README.md b/README.md index c44137d..15e8372 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Alien React Signals +# React Alien Signals -![License](https://img.shields.io/github/license/your-username/alien-react-signals) -![npm](https://img.shields.io/npm/v/alien-react-signals) -![Build](https://img.shields.io/github/actions/workflow/status/your-username/alien-react-signals/ci.yml?branch=main) +![License](https://img.shields.io/github/license/rajaniraiyn/react-alien-signals) +![npm](https://img.shields.io/npm/v/react-alien-signals) +![Build](https://img.shields.io/github/actions/workflow/status/rajaniraiyn/react-alien-signals/docs.yml?branch=main) -Alien React Signals is a **TypeScript** library that provides Jotai-like state management APIs built on top of [Alien Signals](https://github.com/stackblitz/alien-signals). It offers a seamless integration with React, leveraging `useSyncExternalStore` to ensure concurrency-safe re-renders and prevent tearing in concurrent React applications. +React Alien Signals is a **TypeScript** library that provides Jotai-like state management APIs built on top of [Alien Signals](https://github.com/stackblitz/alien-signals). It offers a seamless integration with React, leveraging `useSyncExternalStore` to ensure concurrency-safe re-renders and prevent tearing in concurrent React applications. ## Table of Contents @@ -39,10 +39,10 @@ Alien React Signals is a **TypeScript** library that provides Jotai-like state m ## Installation -Install `alien-react-signals` and its peer dependency `alien-signals` via npm: +Install `react-alien-signals` and its peer dependency `alien-signals` via npm: ```bash -npm install alien-react-signals alien-signals +npm install react-alien-signals alien-signals ``` ## Usage @@ -53,7 +53,7 @@ Create a writable signal and use it within your components. ```tsx import React from "react"; -import { createSignal, useSignal } from "alien-react-signals"; +import { createSignal, useSignal } from "react-alien-signals"; const countSignal = createSignal(0); @@ -81,7 +81,7 @@ import { createSignal, createComputed, useSignalValue, -} from "alien-react-signals"; +} from "react-alien-signals"; const countSignal = createSignal(1); const doubleCount = createComputed(() => countSignal.get() * 2); @@ -105,7 +105,7 @@ import { createSignal, createEffect, useSignalScope, -} from "alien-react-signals"; +} from "react-alien-signals"; const countSignal = createSignal(0); @@ -134,7 +134,7 @@ import { createSignal, unstable_createAsyncComputed, unstable_useAsyncComputedValue, -} from "alien-react-signals"; +} from "react-alien-signals"; const dataSignal = createSignal("initial"); @@ -167,7 +167,7 @@ import { unstable_createComputedArray, unstable_createComputedSet, useSignalValue, -} from "alien-react-signals"; +} from "react-alien-signals"; const numbersSignal = createSignal([1, 2, 3]); const doubledNumbers = unstable_createComputedArray( @@ -195,7 +195,7 @@ export default CollectionsDisplay; ## React Hooks -Alien React Signals provides several hooks to interact with signals: +React Alien Signals provides several hooks to interact with signals: - `useSignal(signal)`: Returns `[value, setValue]`. - `useSignalValue(signal)`: Returns the current value (read-only). diff --git a/src/index.ts b/src/index.ts index 3a4b710..9fea777 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ * It covers basic signals, computed, effects, scopes, asynchronous signals, computed collections, * and exposes React hooks to seamlessly integrate with React using useSyncExternalStore. * - * @module alien-react + * @module react-alien-signals */ import {